After updating Docker (to newest 19.03.13) and postgres (from 12 to 13) my gitlab pipeline now fails - without an traces. It is triggered but pull fails after 1second, without any traces.
Gitlab runner is running, and is not shared with other projects. Docker is connected to registry and can build and push updated images. Have tried to clone to new repo and redo gitlab runner registration. Haven't found any other similar issues posted here. Have run out of ideas of what to try.
Any help will be much appreciated !
The pipeline output (ie no output)
My .gitlab-ci.yml
stages:
- pull
- build
- lint
- push
- cleanup
- deploy
before_script:
- docker login -u "gitlab-ci-token" -p "$CI_BUILD_TOKEN" "$CI_REGISTRY"
pull:
stage: pull
allow_failure: true
script:
- docker pull "$CI_REGISTRY_IMAGE":latest
build:
stage: build
script:
- docker build --tag="$CI_PIPELINE_ID":"$CI_COMMIT_REF_NAME" --cache-from="$CI_REGISTRY_IMAGE":latest .
lint:
stage: lint
script:
- docker-compose -p "$CI_PIPELINE_ID" -f docker-compose.ci.yml run app ls
- docker-compose -p "$CI_PIPELINE_ID" -f docker-compose.ci.yml run app cat tox.ini
- export CI_PIPELINE_ID=$CI_PIPELINE_ID
- export CI_COMMIT_REF_NAME=$CI_COMMIT_REF_NAME
- docker-compose -p "$CI_PIPELINE_ID" -f docker-compose.ci.yml run app flake8 .
push image:
stage: push
only:
- master
- tags
script:
- docker tag "$CI_PIPELINE_ID":"$CI_COMMIT_REF_NAME" "$CI_REGISTRY_IMAGE":"$CI_COMMIT_REF_NAME"
- docker push "$CI_REGISTRY_IMAGE":"$CI_COMMIT_REF_NAME"
push latest:
stage: push
script:
- docker tag "$CI_PIPELINE_ID":"$CI_COMMIT_REF_NAME" "$CI_REGISTRY_IMAGE":latest
- docker push "$CI_REGISTRY_IMAGE":latest
cleanup:
stage: cleanup
when: always
script:
- docker rmi -f "$CI_PIPELINE_ID":"$CI_COMMIT_REF_NAME"
- docker-compose -p "$CI_PIPELINE_ID" -f docker-compose.ci.yml down --remove-orphans
deploy:
stage: deploy
when: manual
only:
- master
- tags
script:
- docker-compose -f docker-compose.deploy.yml pull
- docker-compose -f docker-compose.deploy.yml down --remove-orphans
- docker-compose -f docker-compose.deploy.yml up -d
My docker-compose.ci.yml
version: "3"
services:
app:
image: "${CI_PIPELINE_ID}:${CI_COMMIT_REF_NAME}"
My docker-compose.yml
version: "3"
services:
backend:
image: registry.gitlab.com/my_account/my_project:latest
env_file:
- dev.env
ports:
- "8000:8000"
- "4777:22"
volumes:
- ./backend:/backend
command: "/usr/sbin/sshd -D"
depends_on:
- postgres
postgres:
image: postgres:latest
restart: always
env_file:
- dev.env
ports:
- "5432:5432"
volumes:
- postgres:/var/lib/postgresql/data
volumes:
postgres:
static-files:
media-files:
My docker-compose.deploy.yml
version: "3"
services:
backend:
image: registry.gitlab.com/my_account/my_project:latest
command: "sh /scripts/run.sh"
env_file:
- dev.env
depends_on:
- postgres
volumes:
- media-files:/media-files
- static-files:/static-files
- frontend:/frontend-build
postgres:
image: postgres:latest
env_file:
- dev.env
ports:
- "5432:5432"
volumes:
- postgres:/var/lib/postgresql/data
nginx:
image: nginx:latest
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx:/etc/nginx/conf.d
- /etc/letsencrypt:/etc/letsencrypt
- static-files:/static-files/
- media-files:/media-files/
- frontend:/frontend
volumes:
postgres:
static-files:
media-files:
frontend:
My Dockerfile
FROM continuumio/miniconda:latest
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
RUN apt-get update && apt-get upgrade -y && apt-get install -qqy \
wget \
bzip2 \
graphviz \
libssl-dev \
openssh-server
RUN apt-get update && apt-get install -y curl
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
RUN apt-get update && apt-get install -y nodejs
RUN mkdir /var/run/sshd
RUN echo 'root:screencast' | chpasswd
RUN sed -i '/PermitRootLogin/c\PermitRootLogin yes' /etc/ssh/sshd_config
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
ENV NOTVISIBLE "in users profile"
RUN echo "export VISIBLE=now" >> /etc/profile
RUN mkdir -p /backend
COPY ./backend/requirements.yml /backend/requirements.yml
RUN /opt/conda/bin/conda env create -f /backend/requirements.yml
ENV PATH /opt/conda/envs/backend/bin:$PATH
ENV PYTHONDONTWRITEBYTECODE 1
RUN echo "source activate backend" >~/.bashrc
COPY ./scripts /scripts
RUN chmod +x ./scripts*
COPY ./backend /backend
COPY ./frontend /frontend
WORKDIR /frontend
RUN npm install && npm run build
WORKDIR /backend