Commit 7b069b21 authored by Ayres, Andrew's avatar Ayres, Andrew
Browse files

Move from ssh to https gitlab instructions. Remove tutorial template manual stuff

parent 034168a1
Loading
Loading
Loading
Loading
Loading
+3 −60
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ The setup section detailed the prerequisites required for the tutorial. One of t
To clone the template application, run the following command:

```bash
copier copy https://code.ornl.gov/ndip/project-templates/nova-application-template.git nova_tutorial
copier copy https://code.ornl.gov/ndip/project-templates/nova-application-template-tutorial.git nova_tutorial
```

This command will download the template to a directory called `nova_tutorial`. Copier will prompt you with a series of questions. Please answer the questions as follows:
@@ -174,66 +174,9 @@ The template includes a basic GitLab CI configuration file (`.gitlab-ci.yml`).

Now that we have our template application set up, we need to integrate it with the NDIP platform. The template includes built-in utilities to streamline this process, handling the GitLab repository setup and Galaxy tool XML management.

### Manual Configuration for Tutorial

Since this is a tutorial, we need to modify a few files to properly configure our repository path. In a real project, you would use your own team's project name.

#### Modify Repository Path

1. Open `scripts/git_utils.py` in your editor and modify the line setting the repository path:

   ```python
   # Find this line:
   remote_url += "nova-tutorial"

   # Change it to:
   remote_url += "tutorial/YOUR_USERNAME-nova-tutorial"
   ```
   
   Replace `YOUR_USERNAME` with your actual username (all lowercase).

2. Open `scripts/xml_utils.py` and update the following:

   ```python
   # Find these lines:
   dest_dir = os.path.join(temp_dir, "tools", "neutrons")
   xml_filename = "nova-tutorial.xml"

   
   # Change them to:
   dest_dir = os.path.join(temp_dir, "tools", "neutrons", "tutorials")
   xml_filename = "YOUR_USERNAME-nova-tutorial.xml"
   
   # Then find this line:
   container_path = "ndip/tool-sources/nova-tutorial"
   
   # Change it to:
   container_path = "ndip/tool-sources/tutorial/YOUR_USERNAME-nova-tutorial"
   ```

3. Open `xml/tool.xml` and modify the tool ID:

   ```xml
   <!-- Find this line: -->
   <tool id="nova-tutorial" name="Nova Tutorial" version="@TOOL_VERSION@" profile="22.01">
   
   <!-- Change it to: -->
   <tool id="YOUR_USERNAME-nova-tutorial" name="Nova YOUR_USERNAME Tutorial" version="@TOOL_VERSION@" profile="22.01">
   ```

   And update the repository link in the help section:

   ```xml
   <!-- Find this line: -->
   For more information, see the repository: https://code.ornl.gov/ndip/tool-sources/nova-tutorial
   
   <!-- Change it to: -->
   For more information, see the repository: https://code.ornl.gov/ndip/tool-sources/tutorial/YOUR_USERNAME-nova-tutorial
   ```

### Initialize Your Project Repository

After making these changes, you can initialize your Git repository and push it to the correct location in the NDIP GitLab:
You can initialize your Git repository and push it to the correct location in the NDIP GitLab:

```bash
poetry run init-repo
@@ -279,7 +222,7 @@ After the manual changes we made in the previous step, your tool XML will be cor
To deploy your tool to the NDIP platform, you need to add the XML file to the galaxy-tools repository. The template includes a utility for this:

```bash
poetry run push-xml
poetry run deploy-tool
```

This script will:
+16 −23
Original line number Diff line number Diff line
@@ -60,32 +60,25 @@ The NOVA framework requires you to set environment variables for your NDIP URL a
    **Important:** For security reasons, it is recommended to avoid hardcoding your API key directly in your code. Using environment variables is a more secure and flexible approach.


## 4. Create and Add SSH Key to GitLab
## 5. Create a GitLab Personal Access Token

For detailed instructions, refer to the [official GitLab SSH documentation](https://docs.gitlab.com/user/ssh/#generate-an-ssh-key-pair).

To contribute code to GitLab repositories, you'll need to set up SSH authentication:

1. **Generate an SSH key pair** if you don't already have one:
   ```bash
   ssh-keygen -t ed25519 -C "your_email@example.com"
   ```

2. **Add your SSH key to the ssh-agent**:
   ```bash
   eval "$(ssh-agent -s)"
   ssh-add ~/.ssh/id_ed25519
   ```
::::::::::::::::::::::::::::::::::::::::: callout

3. **Add your public key to your GitLab account**:
   - Copy your public key to clipboard:
     ```bash
     cat ~/.ssh/id_ed25519.pub
     ```
   - Go to GitLab > Preferences > SSH Keys
   - Paste your key and add a descriptive title
If you currently use an ssh key for gitlab, you will still need to create a personal access token for the tutorial.

## 5. Verify Your Setup
::::::::::::::::::::::::::::::::::::::::::::::::::
To interact with repositories on code.ornl.gov, you'll need to create a personal access token:

1. Navigate to [https://code.ornl.gov](https://code.ornl.gov) and log in with your credentials
2. In the left sidebar, select your avatar.
3. Select Edit Profile
4. On the left sidebar, select Access tokens
5. In Token name, enter a name for the token (such as Nova Tutorial)
6. Provide the desired scopes (at minimum, select "read repository", "write repository", and api)
7. Click Create personal access token.
8. **Important** Copy and save your token to your computer immediately. You will no longer have access to it after leaving the page.

## 6. Verify Your Setup

To ensure your setup is correct, run the following command in your terminal within the `nova_tutorial` directory: