Skip to content
Snippets Groups Projects
Commit a6bbcd1e authored by Cyril Christophe Daniel Robert Cros's avatar Cyril Christophe Daniel Robert Cros
Browse files

Check docker

parent 697f9de3
1 merge request!1Check docker
......@@ -2,26 +2,46 @@
variables:
S3_ENDPOINT: "https://s3.embl.de"
S3_BUCKET: "annelids"
JBROWSE_HOSTNAME: "genomes.arendt.embl.de"
stages:
- upload_to_s3
- access_test
- build_container
- deploy_to_cluster
- clean_up_on_failure
s3_access_test:
image: minio/mc
stage: upload_to_s3
stage: access_test
rules:
- changes: # TODO change where necessary
- image/*
before_script:
- mc alias set genomes $S3_ENDPOINT $S3_ACCESS_KEY $S3_SECRET_KEY
script:
- mc ls genomes/$S3_BUCKET
- cd image
cluster_access_test:
image: dtzar/helm-kubectl:3.8.2
stage: deploy_to_cluster
stage: access_test
before_script:
- cd deployment
- echo $KUBECONFIG | base64 -d > /tmp/kubeconf
- export KUBECONFIG=/tmp/kubeconf
script:
- kubectl config current-context
build_nginx_with_jbrowse_config_file:
image: gcr.io/kaniko-project/executor:debug-v0.21.0
stage: build_container
before_script:
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
script:
- /kaniko/executor --cache=true --context $CI_PROJECT_DIR/image
--dockerfile $CI_PROJECT_DIR/image/Dockerfile
--destination $CI_REGISTRY_IMAGE:jbrowse2-$CI_COMMIT_SHORT_SHA
kustomize_build_apply:
image: dtzar/helm-kubectl:3.8.2
stage: deploy_to_cluster
......@@ -29,10 +49,13 @@ kustomize_build_apply:
- echo $KUBECONFIG | base64 -d > /tmp/kubeconf
- export KUBECONFIG=/tmp/kubeconf
script:
- envsubst < deployment/jbrowse2-dep.tmpl > deployment/jbrowse2-dep.yaml
- kubectl apply -k deployment
- kubectl -n $NS wait --for=condition=available --timeout=60s deploy/jbrowse2
- kubectl -n $NS rollout status deployment/jbrowse2
dependencies:
- cluster_access_test
clean_up_k8s_deployment:
image: dtzar/helm-kubectl:3.8.2
stage: clean_up_on_failure
......@@ -42,4 +65,5 @@ clean_up_k8s_deployment:
- export KUBECONFIG=/tmp/kubeconf
script:
- echo 'Failed job, deleting resources'
- kubectl delete -k deployment
\ No newline at end of file
- envsubst < deployment/jbrowse2-dep.tmpl > deployment/jbrowse2-dep.yaml
- kubectl delete -k deployment
# TODO
- use htslib for bgzip and tabix
- npx @jbrowse/cli add-assembly https://s3.embl.de/annelids/pdumv021_genome.fa.gz --name pdumv021
- use SAMtools for faidx
\ No newline at end of file
......@@ -3,7 +3,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: jbrowse2
namespace: jbrowse2-platy
namespace: ${NS}
labels:
name: jbrowse2
spec:
......@@ -16,9 +16,11 @@ spec:
labels:
app: jbrowse2
spec:
imagePullSecrets:
- name: gitlab-token-auth
containers:
- name: jbrowse2
image: nginx:alpine
image: ${CI_REGISTRY_IMAGE}:jbrowse2-${CI_COMMIT_SHORT_SHA}
imagePullPolicy: Always
resources:
requests:
......@@ -36,7 +38,7 @@ apiVersion: v1
kind: Service
metadata:
name: jbrowse2
namespace: jbrowse2-platy
namespace: ${NS}
spec:
selector:
app: jbrowse2
......@@ -50,13 +52,13 @@ apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: jbrowse2
namespace: jbrowse2-platy
namespace: ${NS}
annotations:
traefik.ingress.kubernetes.io/router.tls.certresolver: sectigo
spec:
ingressClassName: external-users
rules:
- host: genomes.arendt.embl.de
- host: ${JBROWSE_HOSTNAME}
http:
paths:
- path: /
......@@ -68,4 +70,4 @@ spec:
name: http
tls:
- hosts:
- genomes.arendt.embl.de
\ No newline at end of file
- ${JBROWSE_HOSTNAME}
\ No newline at end of file
# Stage 1: Jbrowse config file generated
FROM quay.io/biocontainers/jbrowse2:2.10.2--h5284365_0 as jbrowse_builder
WORKDIR /app
COPY jbrowse_script.sh .
RUN ./jbrowse_script.sh
RUN rm -rf annelids/node_modules
# Stage 2: Load into nginx
FROM nginx:alpine
WORKDIR /usr/share/nginx/html
RUN rm -rf ./*
COPY --from=jbrowse_builder /app/annelids/ .
ENTRYPOINT ["nginx", "-g", "daemon off;"]
#!/bin/bash -eux
# Platy only for now
jbrowse create annelids
cd annelids
jbrowse add-assembly https://s3.embl.de/annelids/pdumv021/pdumv021_genome.fa.gz --name pdumv021
jbrowse add-track https://s3.embl.de/annelids/pdumv021/pdumv021.gff.gz -d "Kevin pdumv021 GTF file" -n "Genes models" --category "Annotations"
jbrowse add-track https://s3.embl.de/annelids/pdumv021/transdecoder.gff.gz -d "Kevin runs transdecoder" -n "Transdecoder results" --category "Annotations"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment