Using HPC Rocket with GitLab CI#
Add the SSH key#
Open the file containing the SSH key for the remote machine with a text editor. Copy its content to the clipboard.
Go to your project in GitLab and navigate to
Settings > CI/CD > Variables. Expand theVariablessection and click theAdd variablebutton.Paste the copied private key into the
Valuefield. Enter the namePRIVATE_KEYinto theKeyfield. Then selectFilefrom theTypedropdown menu. The final result should look similar to the image below. After entering the data, clickAdd variableto save.
Add another variable with the key
REMOTE_HOST. Copy the address of the remote machine into theValuefield. SelectVariablefrom theTypedropdown menu. ClickAdd variableto save.Add another variable with the key
REMOTE_USER. Enter the name of your user account on the remote machine into theValuefield. SelectVariablefrom theTypedropdown menu. ClickAdd variableto save.
Add a job for HPC Rocket in your .gitlab-ci.yml#
After adding the SSH keys to GitLab CI you can add a job to your .gitlab-ci.yml as shown below.
run-slurm-job:
  image: python:latest
  stage: deploy
script:
  - pip install hpc-rocket
  - hpc-rocket launch --watch rocket.yml