KubaT
1
Hi All,
I new with Gitlab Ci technology. I don’t have any experiences with GitlabCI. I’ve been given task to do and I lost.
Problem is:
I have a job in pipeline what fails since I use image from gitlab Registry define in .gitlab-ci.yml
Response what I’m getting back is:
unable to load configuration from sh ERROR: Job failed: exit code 1
When I enabled debug I got back
fatal: protocol error: bad line length character: rg 2
Debug: Remote helper quit.
ERROR: Job failed: exit code 1
I build my custom image using docker build and docker push, then I added it into .gitlab-ci.yml . When I run the job I have issue describe above.
When I am using image python:2.7 Gitlab jobs runs ok.
Can you give me help or a tip how can I deal with that problem?
Thanks.
Please include the Dockerfile configurations as well as the .gitlab-ci.yml file so we can debug the issue better.
KubaT
3
Sure
Here is .gitlab-ci.yaml
image: git.{domain}:4567/simplyhosting/dex/dev:latest
#image: python:2.7
#cache:
# paths:
# - /usr/local/lib/python2.7/site-packages/
variables:
# Configure mysql service (https://hub.docker.com/_/mysql/)
MYSQL_DATABASE: 'dex_test'
MYSQL_USER: 'dex'
MYSQL_PASSWORD: 'Thfyk3RPLrhWaG0qZEJI3yrCgd'
MYSQL_RANDOM_ROOT_PASSWORD: 'yes'
RABBITMQ_DEFAULT_USER: 'guest'
RABBITMQ_DEFAULT_PASS: 'guest'
AGENT_NETWORK_TESTING_MODE: '1'
TESTING_MODE: '1'
ES_JAVA_OPTS: "-Xms256m -Xmx256m"
# CI_DEBUG_TRACE: "true"
# GIT_CURL_VERBOSE: "1"
# GIT_DEBUG_LOOKUP: "1"
# GIT_TRACE: "1"
# GIT_TRACE_PACKET: "1"
# GIT_TRANSLOOP_DEBUG: "1"
# GIT_TRANSPORT_HELPER_DEBUG: "1"
services:
- name: mariadb:10.2
alias: mariadb
- name: rabbitmq:3.6
alias: rabbitmq
- name: elasticsearch:5.2
alias: elasticsearch
tests:
stage: test
script:
- apt-get update && apt-get -y install libsnmp-dev dnsmasq rsyslog
#- apt-get -y install rabbitmq-server
#- cp celeryconfig.py-example celeryconfig.py # this does not seam to be working :(
- ping -c 3 mariadb
- ping -c 3 rabbitmq
- ping -c 3 elasticsearch
- python --version
- pip install -r requirements.txt
- ./bin/setup_test_environment.sh
#- rabbitmq-server start -detached
- celery worker -A celery_daemon_tests -l debug -B -Q head3,head1,head2,celery &
- pwd && ls -la
- python load_fixtures.py
- python -m pytest --cov-report term --cov-report html --cov-config .coveragerc --cov=.
- pwd && ls -la
- ls coverage_html_report
artifacts:
paths:
- coverage_html_report/
codestyle:
stage: test
script:
# It requires a lot of memory because some files are really big and have too many errors
- pip install pycodestyle
- pycodestyle core/agents/ core/common/ tests/ api.py
allow_failure: true
pages:
stage: deploy
dependencies:
- tests
script:
- mv coverage_html_report/ public/
artifacts:
paths:
- public
expire_in: 30 days
only:
- master
- live
- beta
- make-dex-work
There is docker-compose.yml
version: ‘3’
services:
app:
build: .
volumes:
- .:/project
depends_on:
- mariadb
- rabbitmq
- elasticsearch
ports:
- "8091:80"
entrypoint: /project/bin/start-web-server.sh
flower:
build: .
volumes:
- .:/project
depends_on:
- mariadb
- rabbitmq
- elasticsearch
ports:
- "5555:5555"
entrypoint: /project/bin/start-flower.sh
worker:
build: .
volumes:
- .:/project
depends_on:
- mariadb
- rabbitmq
- elasticsearch
entrypoint: /project/bin/start-worker.sh
mariadb:
build: docker-images/mariadb
volumes:
- ./docker-images/mariadb/init_test_db.sql:/docker-entrypoint-initdb.d/init_test_db.sql
environment:
- MYSQL_DATABASE=
- MYSQL_USER=
- MYSQL_PASSWORD=
- MYSQL_ROOT_PASSWORD=
ports:
- "3312:3306"
rabbitmq:
image: rabbitmq:3.6
environment:
- RABBITMQ_DEFAULT_USER=guest
- RABBITMQ_DEFAULT_PASS=guest
ports:
- "5672:5672"
expose:
- 5672
elasticsearch:
image: elasticsearch:5.2
container_name: elasticsearch
environment:
- http.host=0.0.0.0
- transport.host=0.0.0.0
- "ES_JAVA_OPTS=-Xms1g -Xmx1g"
ports:
- 9200:9200
- 9300:9300
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
cap_add:
- IPC_LOCK
Dockerfile
FROM python:2.7
RUN mkdir /project
COPY . /project
WORKDIR /project
RUN apt-get update && apt-get install -yqq libsnmp-dev dnsmasq rsyslog \
&& pip install -r requirements.txt
ENTRYPOINT ["uwsgi", "--socket", "0.0.0.0:80", "--protocol=http", "-w", "api", "--callable", "app"]