- Create folder in local desktop
- move there [cd <>]
- git init
- In gitlab, create a project/repo
- Go to Preference by clicking the Gitlab Name. Then go to Access tokens and create token with a name.
- git pull
- add Dockerfile and requirements.txt file and push to gitlab
git remote add origin https://gitlab.nrp-nautilus.io/meftahuddin416/deepcoder-finetune.git
git branch -M main
-- First time use: git push https://meftahuddin416:glpat-xxxxxxxxxxxxxxxxxxxx@gitlab.nrp-nautilus.io/meftahuddin416/deepcoder-finetune.git main -- after that just use: git push -uf origin main
FROM nvidia/cuda:12.1.0-cudnn8-devel-ubuntu22.04
WORKDIR /app
RUN apt-get update && apt-get install -y
python3
python3-pip
&& rm -rf /var/lib/apt/lists/*
RUN ln -s /usr/bin/python3 /usr/bin/python RUN pip install --no-cache-dir notebook
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
torch==2.5.1
torchvision==0.20.1
torchaudio==2.5.1 --index-url https://download.pytorch.org/whl/cu121
-- https://nrp.ai/documentation/userdocs/development/gitlab/
image: gcr.io/kaniko-project/executor:debug
stages:
- build-and-push
variables: GODEBUG: "http2client=0" CACHE_REPO: "$CI_REGISTRY_IMAGE/cache"
build-and-push-job: stage: build-and-push timeout: 3h script: - echo "{"auths":{"$CI_REGISTRY":{"username":"$CI_REGISTRY_USER","password":"$CI_REGISTRY_PASSWORD"}}}" > /kaniko/.docker/config.json - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --cache=false --cache-repo=$CACHE_REPO --destination $CI_REGISTRY_IMAGE:latest --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA
This guide explains how to configure CI/CD variables (CI_REGISTRY_USER and CI_REGISTRY_PASSWORD) for the deepcoder-finetune project to enable the .gitlab-ci.yml pipeline to build and push the Docker image (registry.gitlab.nrp-nautilus.io/meftahuddin416/deepcoder-finetune:latest).
- Options:
- Variable: Standard key-value pair (e.g.,
CI_REGISTRY_USER=meftahuddin416). - File: Stores value as a file path (not needed).
- Variable: Standard key-value pair (e.g.,
- Choice: Use Variable for
CI_REGISTRY_USERandCI_REGISTRY_PASSWORD(simple text values for.gitlab-ci.yml).
- Options:
- Visible: Value appears in job logs (insecure for tokens).
- Masked: Value hidden in logs, revealable in settings (requires alphanumeric, 8+ characters).
- Masked and hidden: Value hidden in logs, non-revealable after saving.
- Choice:
CI_REGISTRY_USER: Visible (usernamemeftahuddin416is not sensitive).CI_REGISTRY_PASSWORD: Masked (token meets regex; allows updates).
- Options:
- Protect variable: Restricts to protected branches/tags (e.g.,
main). - Expand variable reference: Allows referencing other variables (e.g.,
$OTHER_VAR).
- Protect variable: Restricts to protected branches/tags (e.g.,
- Choice:
- Check Protect variable (pipeline runs on
main, per.gitlab-ci.yml). - Uncheck Expand variable reference (static values).
- Check Protect variable (pipeline runs on
- Choice:
CI_REGISTRY_USER: “GitLab username for container registry authentication.”CI_REGISTRY_PASSWORD: “Personal access token for container registry push.”
- Variable name (e.g.,
CI_REGISTRY_USER,CI_REGISTRY_PASSWORD). - Precedence (highest to lowest):
- Pipeline-specific variables (trigger/manual run).
- Project variables (set in Settings -> CI/CD -> Variables).
- Group variables.
- Instance variables (set by NRP admins).
- Predefined variables (e.g.,
$CI_REGISTRY).
- Impact: Project variables override group/instance variables with the same name.
- Choice:
CI_REGISTRY_USER:meftahuddin416CI_REGISTRY_PASSWORD: Personal access token (e.g.,glpat-xxxxxxxxxxxxx) withapi,write_repository,write_registryscopes.
-
Access CI/CD Variables:
- Go to
https://gitlab.nrp-nautilus.io/meftahuddin416/deepcoder-finetune. - Log in as
meftahuddin416. - Navigate to Settings -> CI/CD -> Variables -> Expand.
- Go to
-
Add
CI_REGISTRY_USER:- Click Add variable.
- Set:
- Key:
CI_REGISTRY_USER - Value:
meftahuddin416 - Type: Variable
- Visibility: Visible
- Protect variable: Check
- Description: “GitLab username for container registry authentication.”
- Key:
- Click Add variable.
-
Add
CI_REGISTRY_PASSWORD:- Click Add variable.
- Set:
- Key:
CI_REGISTRY_PASSWORD - Value:
glpat-xxxxxxxxxx(or new token) - Type: Variable
- Visibility: Masked
- Protect variable: Check
- Description: “Personal access token for container registry push.”
- Key:
- Click Add variable.
-
Verify Token Scopes:
- Go to Profile picture -> Preferences -> Access Tokens.
- Ensure the token has
api,write_repository,write_registryscopes. - If invalid, create a new token:
- Name:
deepcoder-finetune-cicd - Scopes:
api,write_repository,write_registry - Click Create personal access token, copy the token, and update
CI_REGISTRY_PASSWORD.
- Name:
-
Check Runners:
- Go to Settings -> CI/CD -> Runners.
- Verify shared or group runners exist (NRP-provided).
- If none, contact NRP admin via
https://nrp.ai/documentationto request a runner.
-
Test Pipeline:
- Push changes to
.gitlab-ci.yml,Dockerfile, orrequirements.txtto trigger the pipeline. - Check CI/CD -> Pipelines for status.
- Verify image in Deploy -> Container Registry (
deepcoder-finetune:latest).
- Push changes to