Viewable by the world
Skip to end of metadata
Go to start of metadata

Nersc has setup up gitlab repositories for our docker images. Among other things Gitlab incorporates a git based source code control system with continuous integration built in.

Step-by-step guide

Prerequisites:

  1.  Docker file created and pushed to JGI gitlab repository
  2.  The gitlab repository for your project has the NERSC runner enabled(Currently we need to request this to be done by the NERSC consultants)

Then:

  1. In your gitlab repo there is a file named .gitlab-ci.yml that will need to be edited
  2. Update the gitlab-ci.yml file to add the info for the shifter registry
  3. Barebones example listed below

    variables:
      GIT_STRATEGY: clone
      GITLAB: registry.gitlab.com
      REGISTRY_USER: JGI
      SHIFTER: registry.services.nersc.gov:8443
      APPLICATION: <Your repository name here>
      RELEASE_TAG: $CI_BUILD_REF_NAME
    
    stages:
      - deploy
    
    deploy:
      stage: deploy
      tags:
        - nersc
        - spin
        - docker
      script:
        - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $GITLAB
        - if [ "$RELEASE_TAG" == "master" ]; then export RELEASE_TAG=latest; fi
        - export DOCKER_IMAGE=`echo $REGISTRY_USER/$APPLICATION:$RELEASE_TAG | tr 'A-Z' 'a-z'` # must be lowercase!
        - echo "Build/deploy $DOCKER_IMAGE"
    
        - docker build -t $GITLAB/$DOCKER_IMAGE .
        - docker push $GITLAB/$DOCKER_IMAGE
        - echo "Pushed $GITLAB/$DOCKER_IMAGE"
    
        - docker tag $GITLAB/$DOCKER_IMAGE $SHIFTER/$DOCKER_IMAGE
        - docker push $SHIFTER/$DOCKER_IMAGE
        - echo "Pushed $SHIFTER/$DOCKER_IMAGE"



  4. Commit the changes to gitlab
  5. The runner will then execute
  6. If it passes then it can then be pulled and run on Denovo
    1. To pull the image:

       

      shifterimg pull registry.services.nersc.gov/jgi/wgsim
       2017-05-15T15:58:26 Pulling Image: docker:registry.services.nersc.gov/jgi/wgsim, status: READY 


    2. And then run:

      shifter --image=registry.services.nersc.gov/jgi/wgsim wgsim <arguments>



 

 

 


 

Additional info on gitlab-ci.yml files

https://docs.gitlab.com/ce/ci/yaml/README.html

 

Related Jiras:

SEQQC-10883 - Getting issue details... STATUS