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 theVariables
section and click theAdd variable
button.Paste the copied private key into the
Value
field. Enter the namePRIVATE_KEY
into theKey
field. Then selectFile
from theType
dropdown menu. The final result should look similar to the image below. After entering the data, clickAdd variable
to save.Add another variable with the key
REMOTE_HOST
. Copy the address of the remote machine into theValue
field. SelectVariable
from theType
dropdown menu. ClickAdd variable
to save.Add another variable with the key
REMOTE_USER
. Enter the name of your user account on the remote machine into theValue
field. SelectVariable
from theType
dropdown menu. ClickAdd variable
to 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