STAMP-project / camp

Amplify your Configuration tests!
https://stamp-project.github.io/camp
MIT License
10 stars 8 forks source link

Can't deploy Citygo configurations generate by CAMP #77

Closed fermenreq closed 4 years ago

fermenreq commented 4 years ago

Characteristics

Description

Cant deploy any of CityGo configurations generated by CAMP

root@0718fb74527d:/camp/samples/stamp/atos# cat camp_execute.log

camp@bash:./out/config_1/images$ bash build_images.sh Sending build context to Docker daemon 2.048kB Sending build context to Docker daemon 57.62MB Step 1/11 : FROM camp-python_0 Sending build context to Docker daemon 2.048kB All images ready. Error response from daemon: Dockerfile parse error line 3: FROM requires either one or three arguments pull access denied for camp-python_0, repository does not exist or may require 'docker login' Error response from daemon: Dockerfile parse error line 3: FROM requires either one or three arguments

camp@bash:./out/config_1$ docker-compose up -d build path /camp/samples/stamp/atos/out/Citygo/Postgres/new either does not exist, is not accessible, or is not a valid URL.

camp@bash:./out/config_1$ docker-compose down --volumes --rmi all build path /camp/samples/stamp/atos/out/Citygo/Postgres/new either does not exist, is not accessible, or is not a valid URL.

Steps to reproduce

node("master") { stage('Pull SCM sut'){ git (credentialsId: 'git-credentials', url: 'https://gitlab.atosresearch.eu/ari/stamp_docker_citygoApp', branch: 'master') } stage('Run CAMP'){ sh ''' docker pull fchauvel/camp:dev; docker run -d --rm -i -t --name camp -v /var/run/docker.sock:/var/run/docker.sock -v /var/jenkins_home/workspace/citygo_camp/:/stamp_docker_citygoApp/ -t fchauvel/camp:dev ''' } stage('CAMP generate'){ sh ''' docker exec -d camp sh -c 'cp -R /stamp_docker_citygoApp/apache/app/* ./samples/stamp/atos/template/citygo/'; docker exec -i camp sh -c 'cd samples/stamp/atos/ && camp generate -d . --all'; exit; ''' } stage('CAMP realize'){ sh ''' docker exec -i camp sh -c 'cd samples/stamp/atos/ && camp realize -d .'; exit; ''' } stage('CAMP execute'){ sh ''' docker exec -i camp sh -c 'cd samples/stamp/atos/ && camp execute -d .'; exit; ''' } }

Other files and URLs

Camp configuration generated

root@0718fb74527d:/camp/samples/stamp/atos/out# ls config_1 config_2 config_3 root@0718fb74527d:/camp/samples/stamp/atos/out# cd config_1 root@0718fb74527d:/camp/samples/stamp/atos/out/config_1# ls configuration.dot configuration.yml docker-compose.yml images

root@0718fb74527d:/camp/samples/stamp/atos/out/config_1# cat configuration.dot digraph Config { node [shape="record",style="filled",fillcolor="white"]; subgraph cluster_1 { label="container 1"; style="filled"; color="lightgrey"; citygo_0 [label="citygo"]; python_0 [label="python"]; ubuntu_0 [label="ubuntu"]; citygo_0 -> python_0; python_0 -> ubuntu_0; } subgraph cluster_2 { label="container 2"; style="filled"; color="lightgrey"; mongo_0 [label="mongo"]; } subgraph cluster_3 { label="container 3"; style="filled"; color="lightgrey"; browser_0 [label="browser"]; } subgraph cluster_4 { label="container 4"; style="filled"; color="lightgrey"; apache_0 [label="apache"]; } subgraph cluster_5 { label="container 5"; style="filled"; color="lightgrey"; hub_0 [label="hub"]; } subgraph cluster_6 { label="container 6"; style="filled"; color="lightgrey"; postgres_0 [label="postgres"]; } citygo_0 -> mongo_0; citygo_0 -> postgres_0; browser_0 -> hub_0; apache_0 -> citygo_0; hub_0 -> apache_0; }

root@0718fb74527d:/camp/samples/stamp/atos/out/config_1# cat configuration.yml instances: apache_0: configuration: {} definition: apache service_providers:

root@0718fb74527d:/camp/samples/stamp/atos/out/config_1# cat docker-compose.yml version: '2' services: db: build: ../Citygo/Postgres/new/ container_name: my_postgresql environment:

root@0718fb74527d:/camp/samples/stamp/atos/out/config_1# cat images/apache_0/ Dockerfile demo_site.conf mpm_event.conf

root@0718fb74527d:/camp/samples/stamp/atos/out/config_1#` cat images/apache_0/Dockerfile

FROM httpd:2.4

MAINTAINER Fernando Mendez Requena fernando.mendez@atos.net

RUN echo "sudo usermod -a -G user apache"

RUN apt-get update -y && \ apt-get upgrade -y && \ apt-get install -y \ libapache2-mod-wsgi \ python2.7 \ python-pip \ lynx \ apache2

RUN pip install mod_wsgi RUN pip install virtualenv ADD ./requirements.txt ./ RUN pip install -r requirements.txt

WORKDIR ./ ADD ./mpm_event.conf ./

RUN mkdir -p /etc/httpd/sites-enabled

RUN mkdir -p /etc/httpd/sites-available

ADD ./demo_site.conf /etc/apache2/sites-available/000-default.conf

ADD ./httpd.conf /usr/local/apache2/conf/httpd.conf

ADD ./httpd.conf /etc/httpd/conf/httpd.conf

CMD service apache2 relaod RUN chmod 777 -R /var/log/apache2 RUN cd /etc/apache2/mods-enabled/ && \ echo "envsubst < $pwd/mpm_event.conf > ./mpm_event.conf" EXPOSE 80 3500

CMD ["apache2ctl", "-D", "FOREGROUND"]

root@0718fb74527d:/camp/samples/stamp/atos/out/config_1/images# cat build_images.sh ... docker build -t camp-python_0 ./python_0 docker build -t camp-citygo_0 ./citygo_0 docker build -t camp-python_0 ./python_0 echo 'All images ready.'

Relationships

Citygo

Help on issue template

Preview to follow the link or open file .github/ISSUE_DOC.md

fchauvel commented 4 years ago

Hello,

Thanks for the feedback.

From the traces you've uploaded, I suspect there are several issues going on here.

  1. We must ensure that the docker-compose file are consistent with the template structure and the camp.yml. I see for instance build: ../Citygo/Postgres/new, which I guess is wrong because CAMP generate configuration into /out/config_1/ (thought I don't know the directory layout you are using).
  2. There may as well be an issue with the script file that CAMP generates. I will double check this and come back you you.
fermenreq commented 4 years ago

Hello @fchauvel ,

please have a look this PR # d0faee60340d9c065e924a166b790173397adb92 which changes in postgres path instance and some fix to lowercases. Could you please update CAMP docker image tagged as dev to Test JMetter test over CI/CD jenkins ?

root@osboxes:/home/osboxes/Desktop/STAMP/camp/samples/stamp/atos# tree -L 3

├── camp.yml ├── Citygo │   ├── apache │   │   ├── demo_site.conf │   │   ├── docker-compose.yml │   │   ├── Dockerfile │   │   ├── mpm_event.conf │   │   └── requirements.txt │   ├── app │   │   └── backend │   ├── nginx │   │   ├── docker-compose.yml │   │   └── nginx │   ├── Postgres │   │   ├── Dockerfile │   │   ├── init-db.sql │   │   └── postgresql.conf │   └── Tests │   └── citygo_tests ├── README.md └── template ├── apache │   ├── demo_site.conf │   ├── Dockerfile │   └── mpm_event.conf ├── browser │   ├── Dockerfile │   └── tests.py ├── citygo │   └── Dockerfile ├── docker-compose-apache-as-proxy.yml ├── docker-compose-apache.yml ├── docker-compose-nginx.yml ├── nginx │   ├── Dockerfile │   └── nginx.tmpl ├── postgres │   ├── Dockerfile │   ├── init-db.sql │   └── postgresql.conf └── python └── Dockerfile

16 directories, 26 files