From 4595f003c2c0ceba9ae941be5b96900ee05527d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20M=C3=A9ndez=20Requena?= Date: Mon, 21 Oct 2019 13:34:22 +0200 Subject: [PATCH 01/11] Update citygo.jmx --- samples/stamp/atos/performance/template/browser/citygo.jmx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/stamp/atos/performance/template/browser/citygo.jmx b/samples/stamp/atos/performance/template/browser/citygo.jmx index 13320e0b..11e36ce5 100755 --- a/samples/stamp/atos/performance/template/browser/citygo.jmx +++ b/samples/stamp/atos/performance/template/browser/citygo.jmx @@ -254,7 +254,7 @@ ${__P(PORT,80)} - /bus/stops/ + /bus/stops GET true false From 5d71f6f3495bcc1afde6a7a5f7550b6c9361904e Mon Sep 17 00:00:00 2001 From: fernando Date: Mon, 21 Oct 2019 19:19:41 +0200 Subject: [PATCH 02/11] Sharing apache logs to browser component --- samples/stamp/atos/performance/camp.yml | 2 +- samples/stamp/atos/performance/template/docker-compose.yml | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/samples/stamp/atos/performance/camp.yml b/samples/stamp/atos/performance/camp.yml index 02b4ede0..aaad64f3 100644 --- a/samples/stamp/atos/performance/camp.yml +++ b/samples/stamp/atos/performance/camp.yml @@ -24,7 +24,7 @@ components: # TODO: This component has to be updated so as to trigger JMeter # instead of pytest tests: - command: bzt citygo-tests/citygo.jmx --option=modules.console.disable=false -report + command: bzt citygo-tests/citygo.jmx --option=modules.console.disable=false -report 2&1> /test-reports/bzt.log reports: location: "citygo-tests" pattern: ".xml" diff --git a/samples/stamp/atos/performance/template/docker-compose.yml b/samples/stamp/atos/performance/template/docker-compose.yml index 42977f69..d9165988 100755 --- a/samples/stamp/atos/performance/template/docker-compose.yml +++ b/samples/stamp/atos/performance/template/docker-compose.yml @@ -4,6 +4,8 @@ services: browser: build: ./browser + volumes: + - /var/log/apache2/:/browser/citygo-tests apache: build: ./apache @@ -26,6 +28,8 @@ services: - BROWSERCONNECTIONENABLED=True ports: - "80:80" + volumes: + - /var/log/apache2/:/browser/citygo-tests web: build: ./citygo @@ -96,4 +100,4 @@ services: - "22222:22222" expose: - "22222" - + From 78c108a961e08d18701f7baf18a2b90f65932ecf Mon Sep 17 00:00:00 2001 From: fernando Date: Tue, 22 Oct 2019 12:12:52 +0200 Subject: [PATCH 03/11] Fix bzt --- samples/stamp/atos/performance/camp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/stamp/atos/performance/camp.yml b/samples/stamp/atos/performance/camp.yml index aaad64f3..02b4ede0 100644 --- a/samples/stamp/atos/performance/camp.yml +++ b/samples/stamp/atos/performance/camp.yml @@ -24,7 +24,7 @@ components: # TODO: This component has to be updated so as to trigger JMeter # instead of pytest tests: - command: bzt citygo-tests/citygo.jmx --option=modules.console.disable=false -report 2&1> /test-reports/bzt.log + command: bzt citygo-tests/citygo.jmx --option=modules.console.disable=false -report reports: location: "citygo-tests" pattern: ".xml" From 22c1bde201d041917290439b792fb7a351a88692 Mon Sep 17 00:00:00 2001 From: fernando Date: Tue, 22 Oct 2019 15:02:23 +0200 Subject: [PATCH 04/11] change path volumes --- samples/stamp/atos/performance/template/docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/stamp/atos/performance/template/docker-compose.yml b/samples/stamp/atos/performance/template/docker-compose.yml index d9165988..e15c6302 100755 --- a/samples/stamp/atos/performance/template/docker-compose.yml +++ b/samples/stamp/atos/performance/template/docker-compose.yml @@ -5,7 +5,7 @@ services: browser: build: ./browser volumes: - - /var/log/apache2/:/browser/citygo-tests + - ./logs/:/browser/citygo-tests/apache-logs apache: build: ./apache @@ -29,7 +29,7 @@ services: ports: - "80:80" volumes: - - /var/log/apache2/:/browser/citygo-tests + - ./logs:/var/log/apache2/ web: build: ./citygo From d5a77676e271c18132869b8e3dbfda1a55cdee16 Mon Sep 17 00:00:00 2001 From: fernando Date: Wed, 23 Oct 2019 10:20:45 +0200 Subject: [PATCH 05/11] Update template tree for use case scenario 2 --- .../functional/template/apache/Dockerfile | 43 -- .../functional/template/apache/demo_site.conf | 40 -- .../functional/template/apache/mpm_event.conf | 19 - .../functional/template/browser/Dockerfile | 15 +- .../functional/template/citygo/Dockerfile | 26 +- .../template/docker-compose-apache.yml | 126 ---- .../template/docker-compose-nginx.yml | 42 +- .../functional/template/postgres/Dockerfile | 23 - .../functional/template/postgres/init-db.sql | 8 - .../template/postgres/postgresql.conf | 596 ------------------ 10 files changed, 50 insertions(+), 888 deletions(-) delete mode 100755 samples/stamp/atos/functional/template/apache/Dockerfile delete mode 100755 samples/stamp/atos/functional/template/apache/demo_site.conf delete mode 100755 samples/stamp/atos/functional/template/apache/mpm_event.conf delete mode 100755 samples/stamp/atos/functional/template/docker-compose-apache.yml delete mode 100755 samples/stamp/atos/functional/template/postgres/Dockerfile delete mode 100644 samples/stamp/atos/functional/template/postgres/init-db.sql delete mode 100755 samples/stamp/atos/functional/template/postgres/postgresql.conf diff --git a/samples/stamp/atos/functional/template/apache/Dockerfile b/samples/stamp/atos/functional/template/apache/Dockerfile deleted file mode 100755 index 2f4562c8..00000000 --- a/samples/stamp/atos/functional/template/apache/Dockerfile +++ /dev/null @@ -1,43 +0,0 @@ -FROM httpd:2.4 - -MAINTAINER Fernando Mendez Requena - -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"] - diff --git a/samples/stamp/atos/functional/template/apache/demo_site.conf b/samples/stamp/atos/functional/template/apache/demo_site.conf deleted file mode 100755 index b2e460b6..00000000 --- a/samples/stamp/atos/functional/template/apache/demo_site.conf +++ /dev/null @@ -1,40 +0,0 @@ -WSGIPythonPath /var/www/html/ShowcaseServer/demo_site - - - # The ServerName directive sets the request scheme, hostname and port that - # the server uses to identify itself. This is used when creating - # redirection URLs. In the context of virtual hosts, the ServerName - # specifies what hostname must appear in the request's Host: header to - # match this virtual host. For the default virtual host (this file) this - # value is not decisive as it is used as a last resort host regardless. - # However, you must set it for any further virtual host explicitly. - #ServerName www.example.com - - ServerAdmin webmaster@localhost - DocumentRoot /var/www/html/ShowcaseServer - - Alias /static /var/www/html/ShowcaseServer/demo_site/dashboard/static - - - WSGIScriptAlias / /var/www/html/ShowcaseServer/demo_site/citygo_settings/wsgi.py - - # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, - # error, crit, alert, emerg. - # It is also possible to configure the loglevel for particular - # modules, e.g. - #LogLevel info ssl:warn - - ErrorLog ${APACHE_LOG_DIR}/error.log - CustomLog ${APACHE_LOG_DIR}/access.log combined - LogLevel debug - - #CustomLog ${APACHE_LOG_DIR}/malaga_showcase_debug.log combined - - - # For most configuration files from conf-available/, which are - # enabled or disabled at a global level, it is possible to - # include a line for only one particular virtual host. For example the - # following line enables the CGI configuration for this host only - # after it has been globally disabled with "a2disconf". - #Include conf-available/serve-cgi-bin.conf - diff --git a/samples/stamp/atos/functional/template/apache/mpm_event.conf b/samples/stamp/atos/functional/template/apache/mpm_event.conf deleted file mode 100755 index 5c95b1b2..00000000 --- a/samples/stamp/atos/functional/template/apache/mpm_event.conf +++ /dev/null @@ -1,19 +0,0 @@ -# event MPM -# StartServers: initial number of server processes to start -# MinSpareThreads: minimum number of worker threads which are kept spare -# MaxSpareThreads: maximum number of worker threads which are kept spare -# ThreadsPerChild: constant number of worker threads in each server process -# MaxRequestWorkers: maximum number of worker threads -# MaxConnectionsPerChild: maximum number of requests a server process serves - - StartServers ${StartServers} - MinSpareThreads ${MinSpareThreads} - MaxSpareThreads ${MaxSpareThreads} - ThreadLimit ${ThreadLimit} - ThreadsPerChild ${ThreadsPerChild} - MaxRequestWorkers ${MaxRequestWorkers} - MaxConnectionsPerChild ${MaxConnectionsPerChild} - - -# vim: syntax=apache ts=4 sw=4 sts=4 sr noet - diff --git a/samples/stamp/atos/functional/template/browser/Dockerfile b/samples/stamp/atos/functional/template/browser/Dockerfile index 498eb2ec..ec6ceb9c 100755 --- a/samples/stamp/atos/functional/template/browser/Dockerfile +++ b/samples/stamp/atos/functional/template/browser/Dockerfile @@ -6,13 +6,20 @@ RUN sudo apt-get update && \ python2.7 \ python-pip -WORKDIR ./ +WORKDIR /browser + +USER root +RUN chmod 777 -R /browser RUN pip install --upgrade pip -ADD ./requirements.txt ./ -RUN pip install -r requirements.txt +# Install BlazeMetter to run performance Tests +RUN sudo -H pip install bzt +COPY ./citygo.jmx /browser/citygo-tests/citygo.jmx + +#Funtional Tests +COPY ./tests.py /browser/citygo-tests/citygo.jmx/tests.py -COPY ./tests.py citygo-tests/tests.py +RUN ls -lR /browser CMD echo "Ready!" diff --git a/samples/stamp/atos/functional/template/citygo/Dockerfile b/samples/stamp/atos/functional/template/citygo/Dockerfile index bd949d5c..77510bc6 100644 --- a/samples/stamp/atos/functional/template/citygo/Dockerfile +++ b/samples/stamp/atos/functional/template/citygo/Dockerfile @@ -1,6 +1,28 @@ - +# See explanation in the README. FROM camp/runtime +# Describe here how to install Citygo ontop of the "python" component. +ENV PYTHONUNBUFFERED 1 +ENV C_FORCE_ROOT true -# Describe here how to install Citygo ontop of the "python" component. +# Set work directory +WORKDIR /usr/src/app + +RUN chmod -R +x /usr/src/app +RUN pip install --upgrade pip + +COPY ./requirements.txt /usr/src/app/ +RUN pip install -r requirements.txt + +#copy entrypoint.sh +COPY ./entrypoint.sh /usr/src/app/ + +RUN chmod +x /usr/src/app/entrypoint.sh +# copy project +COPY . /usr/src/app/ + +EXPOSE 80 + +# run entrypoint.sh +ENTRYPOINT ["/bin/sh","/usr/src/app/entrypoint.sh"] diff --git a/samples/stamp/atos/functional/template/docker-compose-apache.yml b/samples/stamp/atos/functional/template/docker-compose-apache.yml deleted file mode 100755 index 72dbf477..00000000 --- a/samples/stamp/atos/functional/template/docker-compose-apache.yml +++ /dev/null @@ -1,126 +0,0 @@ -version: '2' - -services: - - db: - build: ./postgres - container_name: my_postgresql - environment: - - max_connections=500 - - shared_buffers=256 - - port=5432 - - POSTGRES_DB=citygo_malaga - - POSTGRES_USER=citygo - - POSTGRES_PASSWORD=5X6sdoq0!?az=v2aSX - - PGDATA=/var/lib/postgresql/data/pgdata - ports: - - "5432:5432" - volumes: - - postgres_data:/var/lib/postgresql/data/ - expose: - - "5432" - networks: - - my-app-bridge - - apache: - build: . - container_name: my_apache - environment: - - HTTPD_VERSION=2.4 - - StartServers=2 - - MinSpareThreads=25 - - MaxSpareThreads=75 - - ThreadLimit=64 - - ThreadsPerChild=25 - - MaxRequestWorkers=150 - - MaxConnectionsPerChild=0 - - DJANGO_SETTINGS_MODULE=citygo_settings.settings - - BROWSERNAME=chrome - - PLATFORM=LINUX - - JAVASCRIPTENABLED=True - - MAXINSTANCES=50 - - CSSSELECTORSENABLED=True - - BROWSERCONNECTIONENABLED=True - volumes: - #- ../Citygo/www:/var/www/html - - ./app/:/usr/src/app/ - - static_volume:/usr/src/app/static - ports: - - "80:80" - depends_on: - - db - - mongo - networks: - - my-app-bridge - - web: - build: ./citygo - container_name: "my_web" - restart: always - environment: - - DJANGO_SETTINGS_MODULE=citygo_settings.settings - - BROWSERNAME=chrome - - PLATFORM=LINUX - - JAVASCRIPTENABLED=True - - MAXINSTANCES=50 - - CSSSELECTORSENABLED=True - - BROWSERCONNECTIONENABLED=True - networks: - - my-app-bridge - volumes: - - ./app/:/usr/src/app/ - - static_volume:/usr/src/app/static - depends_on: - - db - - mongo - - apache - ports: - - "8000:8000" - - hub: - container_name: "selenium_hub" - image: selenium/hub - volumes: - - /dev/shm:/dev/shm/ - ports: - - "4444:4444" - networks: - - my-app-bridge - - - selenium_chrome: - container_name: selenium_chrome - image: selenium/node-chrome-debug - environment: - - HUB_PORT_4444_TCP_ADDR=hub - - HUB_PORT_4444_TCP_PORT=4444 - ports: - - "5900:5900" - depends_on: - - hub - networks: - - my-app-bridge - - mongo: - container_name: "my_mongo" - image: mongo:4.0.6-xenial - environment: - - MONGO_DATA_DIR=/data/db - - MONGO_LOG_DIR=/dev/null - volumes: - - ./data/db:/data/db - ports: - - "27017:27017" - expose: - - "27017" - networks: - - my-app-bridge - - -volumes: - postgres_data: - static_volume: - -networks: - my-app-bridge: - driver: bridge diff --git a/samples/stamp/atos/functional/template/docker-compose-nginx.yml b/samples/stamp/atos/functional/template/docker-compose-nginx.yml index eeb2e251..3f9a00bc 100755 --- a/samples/stamp/atos/functional/template/docker-compose-nginx.yml +++ b/samples/stamp/atos/functional/template/docker-compose-nginx.yml @@ -5,28 +5,29 @@ # # Maintainer: Fernando Méndez Requena - fernando.mendez@atos.net -version: '2' +version: '3' services: + + browser: + build: ./browser + volumes: + - ./logs/:/browser/citygo-tests/nginx-logs + db: - container_name: my_postgres - build: ./postgres + image: postgres:9.3 + container_name: my_postgresql + restart: always environment: - - max_connections=500 - - shared_buffers=256 - - port=5432 - POSTGRES_DB=citygo_malaga - POSTGRES_USER=citygo - POSTGRES_PASSWORD=5X6sdoq0!?az=v2aSX - - PGDATA=/var/lib/postgresql/data/pgdata - volumes: - - postgres_data:/var/lib/postgresql/data/ - networks: - - dsne-django-nginx + - PGDATA=/var/lib/postgresql/data/pgdata + command: sh -c "docker-entrypoint.sh -c 'port=6666' -c 'listen_addresses='*'' -c 'max_connections=500' -c 'shared_buffers=256'" ports: - - "5432:5432" + - "6666:6666" expose: - - "5432" + - "6666" mongo: container_name: "my_mongo" @@ -40,8 +41,6 @@ services: - "27017:27017" expose: - "27017" - networks: - - dsne-django-nginx nginx: build: ./nginx @@ -68,10 +67,9 @@ services: - ./app/:/usr/src/app/ - static_volume:/usr/src/app/static - dsne-nginx-cert:/etc/ssl/certs:ro + - ./logs/:/var/log/nginx/ depends_on: - web - networks: - - dsne-django-nginx web: build: ./citygo @@ -86,8 +84,6 @@ services: - MAXINSTANCES=50 - CSSSELECTORSENABLED=True - BROWSERCONNECTIONENABLED=True - networks: - - dsne-django-nginx volumes: - ./app/:/usr/src/app/ - static_volume:/usr/src/app/static @@ -102,8 +98,6 @@ services: image: selenium/hub volumes: - /dev/shm:/dev/shm/ - networks: - - dsne-django-nginx ports: - "4444:4444" @@ -117,14 +111,8 @@ services: - "5900:5900" depends_on: - hub - networks: - - dsne-django-nginx volumes: static_volume: dsne-nginx-cert: postgres_data: - -networks: - dsne-django-nginx: - driver: bridge diff --git a/samples/stamp/atos/functional/template/postgres/Dockerfile b/samples/stamp/atos/functional/template/postgres/Dockerfile deleted file mode 100755 index 5277657a..00000000 --- a/samples/stamp/atos/functional/template/postgres/Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -FROM postgres:9.3 - -MAINTAINER Fernando Mendez Requena - -RUN apt-get update \ - && apt-get install -my wget gnupg \ - && apt-get install -y gettext-base - -USER postgres - -WORKDIR ./ - -ADD ./init-db.sql ./ - -RUN echo "/etc/init.d/postgresql start" -ADD ./postgresql.conf /etc/ - -RUN echo "psql -a -f init-db.sql" - -RUN cd /etc && \ - echo "envsubst /var/lib/postgresql/data/postgresql.conf || cat /var/lib/postgresql/data/postgresql.conf" - -EXPOSE 2345 diff --git a/samples/stamp/atos/functional/template/postgres/init-db.sql b/samples/stamp/atos/functional/template/postgres/init-db.sql deleted file mode 100644 index 569ad7a9..00000000 --- a/samples/stamp/atos/functional/template/postgres/init-db.sql +++ /dev/null @@ -1,8 +0,0 @@ -CREATE DATABASE citygo_malaga; -CREATE USER citygo WITH PASSWORD '5X6sdoq0!?az=v2aSX'; -ALTER ROLE citygo SET client_encoding TO 'utf8'; -ALTER ROLE citygo SET default_transaction_isolation TO 'read committed'; -ALTER ROLE citygo SET timezone TO 'UTC'; -GRANT ALL PRIVILEGES ON DATABASE citygo_malaga TO citygo; -\q -Exit diff --git a/samples/stamp/atos/functional/template/postgres/postgresql.conf b/samples/stamp/atos/functional/template/postgres/postgresql.conf deleted file mode 100755 index 5f9c8f51..00000000 --- a/samples/stamp/atos/functional/template/postgres/postgresql.conf +++ /dev/null @@ -1,596 +0,0 @@ -# ----------------------------- -# PostgreSQL configuration file -# ----------------------------- -# -# This file consists of lines of the form: -# -# name = value -# -# (The "=" is optional.) Whitespace may be used. Comments are introduced with -# "#" anywhere on a line. The complete list of parameter names and allowed -# values can be found in the PostgreSQL documentation. -# -# The commented-out settings shown in this file represent the default values. -# Re-commenting a setting is NOT sufficient to revert it to the default value; -# you need to reload the server. -# -# This file is read on server startup and when the server receives a SIGHUP -# signal. If you edit the file on a running system, you have to SIGHUP the -# server for the changes to take effect, or use "pg_ctl reload". Some -# parameters, which are marked below, require a server shutdown and restart to -# take effect. -# -# Any parameter can also be given as a command-line option to the server, e.g., -# "postgres -c log_connections=on". Some parameters can be changed at run time -# with the "SET" SQL command. -# -# Memory units: kB = kilobytes Time units: ms = milliseconds -# MB = megabytes s = seconds -# GB = gigabytes min = minutes -# h = hours -# d = days - - -#------------------------------------------------------------------------------ -# FILE LOCATIONS -#------------------------------------------------------------------------------ - -# The default values of these variables are driven from the -D command-line -# option or PGDATA environment variable, represented here as ConfigDir. - -#data_directory = 'ConfigDir' # use data in another directory - # (change requires restart) -#hba_file = 'ConfigDir/pg_hba.conf' # host-based authentication file - # (change requires restart) -#ident_file = 'ConfigDir/pg_ident.conf' # ident configuration file - # (change requires restart) - -# If external_pid_file is not explicitly set, no extra PID file is written. -#external_pid_file = '' # write an extra PID file - # (change requires restart) - - -#------------------------------------------------------------------------------ -# CONNECTIONS AND AUTHENTICATION -#------------------------------------------------------------------------------ - -# - Connection Settings - - -#listen_addresses = 'localhost' # what IP address(es) to listen on; - # comma-separated list of addresses; - # defaults to 'localhost'; use '*' for all - # (change requires restart) -port = ${port} # (change requires restart) -max_connections = ${max_connections} # (change requires restart) -# Note: Increasing max_connections costs ~400 bytes of shared memory per -# connection slot, plus lock space (see max_locks_per_transaction). -#superuser_reserved_connections = 3 # (change requires restart) -#unix_socket_directories = '/tmp' # comma-separated list of directories - # (change requires restart) -#unix_socket_group = '' # (change requires restart) -#unix_socket_permissions = 0777 # begin with 0 to use octal notation - # (change requires restart) -#bonjour = off # advertise server via Bonjour - # (change requires restart) -#bonjour_name = '' # defaults to the computer name - # (change requires restart) - -# - Security and Authentication - - -#authentication_timeout = 1min # 1s-600s -#ssl = off # (change requires restart) -#ssl_ciphers = 'DEFAULT:!LOW:!EXP:!MD5:@STRENGTH' # allowed SSL ciphers - # (change requires restart) -#ssl_renegotiation_limit = 512MB # amount of data between renegotiations -#ssl_cert_file = 'server.crt' # (change requires restart) -#ssl_key_file = 'server.key' # (change requires restart) -#ssl_ca_file = '' # (change requires restart) -#ssl_crl_file = '' # (change requires restart) -#password_encryption = on -#db_user_namespace = off - -# Kerberos and GSSAPI -#krb_server_keyfile = '' -#krb_srvname = 'postgres' # (Kerberos only) -#krb_caseins_users = off - -# - TCP Keepalives - -# see "man 7 tcp" for details - -#tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds; - # 0 selects the system default -#tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds; - # 0 selects the system default -#tcp_keepalives_count = 0 # TCP_KEEPCNT; - # 0 selects the system default - - -#------------------------------------------------------------------------------ -# RESOURCE USAGE (except WAL) -#------------------------------------------------------------------------------ - -# - Memory - - -shared_buffers = ${shared_buffers}MB # min 128kB - # (change requires restart) -#temp_buffers = 8MB # min 800kB -#max_prepared_transactions = 0 # zero disables the feature - # (change requires restart) -# Note: Increasing max_prepared_transactions costs ~600 bytes of shared memory -# per transaction slot, plus lock space (see max_locks_per_transaction). -# It is not advisable to set max_prepared_transactions nonzero unless you -# actively intend to use prepared transactions. -#work_mem = 1MB # min 64kB -#maintenance_work_mem = 16MB # min 1MB -#max_stack_depth = 2MB # min 100kB - -# - Disk - - -#temp_file_limit = -1 # limits per-session temp file space - # in kB, or -1 for no limit - -# - Kernel Resource Usage - - -#max_files_per_process = 1000 # min 25 - # (change requires restart) -#shared_preload_libraries = '' # (change requires restart) - -# - Cost-Based Vacuum Delay - - -#vacuum_cost_delay = 0 # 0-100 milliseconds -#vacuum_cost_page_hit = 1 # 0-10000 credits -#vacuum_cost_page_miss = 10 # 0-10000 credits -#vacuum_cost_page_dirty = 20 # 0-10000 credits -#vacuum_cost_limit = 200 # 1-10000 credits - -# - Background Writer - - -#bgwriter_delay = 200ms # 10-10000ms between rounds -#bgwriter_lru_maxpages = 100 # 0-1000 max buffers written/round -#bgwriter_lru_multiplier = 2.0 # 0-10.0 multipler on buffers scanned/round - -# - Asynchronous Behavior - - -#effective_io_concurrency = 1 # 1-1000; 0 disables prefetching - - -#------------------------------------------------------------------------------ -# WRITE AHEAD LOG -#------------------------------------------------------------------------------ - -# - Settings - - -#wal_level = minimal # minimal, archive, or hot_standby - # (change requires restart) -#fsync = on # turns forced synchronization on or off -#synchronous_commit = on # synchronization level; - # off, local, remote_write, or on -#wal_sync_method = fsync # the default is the first option - # supported by the operating system: - # open_datasync - # fdatasync (default on Linux) - # fsync - # fsync_writethrough - # open_sync -#full_page_writes = on # recover from partial page writes -#wal_buffers = -1 # min 32kB, -1 sets based on shared_buffers - # (change requires restart) -#wal_writer_delay = 200ms # 1-10000 milliseconds - -#commit_delay = 0 # range 0-100000, in microseconds -#commit_siblings = 5 # range 1-1000 - -# - Checkpoints - - -#checkpoint_segments = 3 # in logfile segments, min 1, 16MB each -#checkpoint_timeout = 5min # range 30s-1h -#checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0 -#checkpoint_warning = 30s # 0 disables - -# - Archiving - - -#archive_mode = off # allows archiving to be done - # (change requires restart) -#archive_command = '' # command to use to archive a logfile segment - # placeholders: %p = path of file to archive - # %f = file name only - # e.g. 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f' -#archive_timeout = 0 # force a logfile segment switch after this - # number of seconds; 0 disables - - -#------------------------------------------------------------------------------ -# REPLICATION -#------------------------------------------------------------------------------ - -# - Sending Server(s) - - -# Set these on the master and on any standby that will send replication data. - -#max_wal_senders = 0 # max number of walsender processes - # (change requires restart) -#wal_keep_segments = 0 # in logfile segments, 16MB each; 0 disables -#wal_sender_timeout = 60s # in milliseconds; 0 disables - -# - Master Server - - -# These settings are ignored on a standby server. - -#synchronous_standby_names = '' # standby servers that provide sync rep - # comma-separated list of application_name - # from standby(s); '*' = all -#vacuum_defer_cleanup_age = 0 # number of xacts by which cleanup is delayed - -# - Standby Servers - - -# These settings are ignored on a master server. - -#hot_standby = off # "on" allows queries during recovery - # (change requires restart) -#max_standby_archive_delay = 30s # max delay before canceling queries - # when reading WAL from archive; - # -1 allows indefinite delay -#max_standby_streaming_delay = 30s # max delay before canceling queries - # when reading streaming WAL; - # -1 allows indefinite delay -#wal_receiver_status_interval = 10s # send replies at least this often - # 0 disables -#hot_standby_feedback = off # send info from standby to prevent - # query conflicts -#wal_receiver_timeout = 60s # time that receiver waits for - # communication from master - # in milliseconds; 0 disables - - -#------------------------------------------------------------------------------ -# QUERY TUNING -#------------------------------------------------------------------------------ - -# - Planner Method Configuration - - -#enable_bitmapscan = on -#enable_hashagg = on -#enable_hashjoin = on -#enable_indexscan = on -#enable_indexonlyscan = on -#enable_material = on -#enable_mergejoin = on -#enable_nestloop = on -#enable_seqscan = on -#enable_sort = on -#enable_tidscan = on - -# - Planner Cost Constants - - -#seq_page_cost = 1.0 # measured on an arbitrary scale -#random_page_cost = 4.0 # same scale as above -#cpu_tuple_cost = 0.01 # same scale as above -#cpu_index_tuple_cost = 0.005 # same scale as above -#cpu_operator_cost = 0.0025 # same scale as above -#effective_cache_size = 128MB - -# - Genetic Query Optimizer - - -#geqo = on -#geqo_threshold = 12 -#geqo_effort = 5 # range 1-10 -#geqo_pool_size = 0 # selects default based on effort -#geqo_generations = 0 # selects default based on effort -#geqo_selection_bias = 2.0 # range 1.5-2.0 -#geqo_seed = 0.0 # range 0.0-1.0 - -# - Other Planner Options - - -#default_statistics_target = 100 # range 1-10000 -#constraint_exclusion = partition # on, off, or partition -#cursor_tuple_fraction = 0.1 # range 0.0-1.0 -#from_collapse_limit = 8 -#join_collapse_limit = 8 # 1 disables collapsing of explicit - # JOIN clauses - - -#------------------------------------------------------------------------------ -# ERROR REPORTING AND LOGGING -#------------------------------------------------------------------------------ - -# - Where to Log - - -#log_destination = 'stderr' # Valid values are combinations of - # stderr, csvlog, syslog, and eventlog, - # depending on platform. csvlog - # requires logging_collector to be on. - -# This is used when logging to stderr: -#logging_collector = off # Enable capturing of stderr and csvlog - # into log files. Required to be on for - # csvlogs. - # (change requires restart) - -# These are only used if logging_collector is on: -#log_directory = 'pg_log' # directory where log files are written, - # can be absolute or relative to PGDATA -#log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # log file name pattern, - # can include strftime() escapes -#log_file_mode = 0600 # creation mode for log files, - # begin with 0 to use octal notation -#log_truncate_on_rotation = off # If on, an existing log file with the - # same name as the new log file will be - # truncated rather than appended to. - # But such truncation only occurs on - # time-driven rotation, not on restarts - # or size-driven rotation. Default is - # off, meaning append to existing files - # in all cases. -#log_rotation_age = 1d # Automatic rotation of logfiles will - # happen after that time. 0 disables. -#log_rotation_size = 10MB # Automatic rotation of logfiles will - # happen after that much log output. - # 0 disables. - -# These are relevant when logging to syslog: -#syslog_facility = 'LOCAL0' -#syslog_ident = 'postgres' - -# This is only relevant when logging to eventlog (win32): -#event_source = 'PostgreSQL' - -# - When to Log - - -#client_min_messages = notice # values in order of decreasing detail: - # debug5 - # debug4 - # debug3 - # debug2 - # debug1 - # log - # notice - # warning - # error - -#log_min_messages = warning # values in order of decreasing detail: - # debug5 - # debug4 - # debug3 - # debug2 - # debug1 - # info - # notice - # warning - # error - # log - # fatal - # panic - -#log_min_error_statement = error # values in order of decreasing detail: - # debug5 - # debug4 - # debug3 - # debug2 - # debug1 - # info - # notice - # warning - # error - # log - # fatal - # panic (effectively off) - -#log_min_duration_statement = -1 # -1 is disabled, 0 logs all statements - # and their durations, > 0 logs only - # statements running at least this number - # of milliseconds - - -# - What to Log - - -#debug_print_parse = off -#debug_print_rewritten = off -#debug_print_plan = off -#debug_pretty_print = on -#log_checkpoints = off -#log_connections = off -#log_disconnections = off -#log_duration = off -#log_error_verbosity = default # terse, default, or verbose messages -#log_hostname = off -#log_line_prefix = '' # special values: - # %a = application name - # %u = user name - # %d = database name - # %r = remote host and port - # %h = remote host - # %p = process ID - # %t = timestamp without milliseconds - # %m = timestamp with milliseconds - # %i = command tag - # %e = SQL state - # %c = session ID - # %l = session line number - # %s = session start timestamp - # %v = virtual transaction ID - # %x = transaction ID (0 if none) - # %q = stop here in non-session - # processes - # %% = '%' - # e.g. '<%u%%%d> ' -#log_lock_waits = off # log lock waits >= deadlock_timeout -#log_statement = 'none' # none, ddl, mod, all -#log_temp_files = -1 # log temporary files equal or larger - # than the specified size in kilobytes; - # -1 disables, 0 logs all temp files -#log_timezone = 'GMT' - - -#------------------------------------------------------------------------------ -# RUNTIME STATISTICS -#------------------------------------------------------------------------------ - -# - Query/Index Statistics Collector - - -#track_activities = on -#track_counts = on -#track_io_timing = off -#track_functions = none # none, pl, all -#track_activity_query_size = 1024 # (change requires restart) -#update_process_title = on -#stats_temp_directory = 'pg_stat_tmp' - - -# - Statistics Monitoring - - -#log_parser_stats = off -#log_planner_stats = off -#log_executor_stats = off -#log_statement_stats = off - - -#------------------------------------------------------------------------------ -# AUTOVACUUM PARAMETERS -#------------------------------------------------------------------------------ - -#autovacuum = on # Enable autovacuum subprocess? 'on' - # requires track_counts to also be on. -#log_autovacuum_min_duration = -1 # -1 disables, 0 logs all actions and - # their durations, > 0 logs only - # actions running at least this number - # of milliseconds. -#autovacuum_max_workers = 3 # max number of autovacuum subprocesses - # (change requires restart) -#autovacuum_naptime = 1min # time between autovacuum runs -#autovacuum_vacuum_threshold = 50 # min number of row updates before - # vacuum -#autovacuum_analyze_threshold = 50 # min number of row updates before - # analyze -#autovacuum_vacuum_scale_factor = 0.2 # fraction of table size before vacuum -#autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze -#autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum - # (change requires restart) -#autovacuum_multixact_freeze_max_age = 400000000 # maximum Multixact age - # before forced vacuum - # (change requires restart) -#autovacuum_vacuum_cost_delay = 20ms # default vacuum cost delay for - # autovacuum, in milliseconds; - # -1 means use vacuum_cost_delay -#autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit for - # autovacuum, -1 means use - # vacuum_cost_limit - - -#------------------------------------------------------------------------------ -# CLIENT CONNECTION DEFAULTS -#------------------------------------------------------------------------------ - -# - Statement Behavior - - -#search_path = '"$user",public' # schema names -#default_tablespace = '' # a tablespace name, '' uses the default -#temp_tablespaces = '' # a list of tablespace names, '' uses - # only default tablespace -#check_function_bodies = on -#default_transaction_isolation = 'read committed' -#default_transaction_read_only = off -#default_transaction_deferrable = off -#session_replication_role = 'origin' -#statement_timeout = 0 # in milliseconds, 0 is disabled -#lock_timeout = 0 # in milliseconds, 0 is disabled -#vacuum_freeze_min_age = 50000000 -#vacuum_freeze_table_age = 150000000 -#vacuum_multixact_freeze_min_age = 5000000 -#vacuum_multixact_freeze_table_age = 150000000 -#bytea_output = 'hex' # hex, escape -#xmlbinary = 'base64' -#xmloption = 'content' - -# - Locale and Formatting - - -#datestyle = 'iso, mdy' -#intervalstyle = 'postgres' -#timezone = 'GMT' -#timezone_abbreviations = 'Default' # Select the set of available time zone - # abbreviations. Currently, there are - # Default - # Australia - # India - # You can create your own file in - # share/timezonesets/. -#extra_float_digits = 0 # min -15, max 3 -#client_encoding = sql_ascii # actually, defaults to database - # encoding - -# These settings are initialized by initdb, but they can be changed. -#lc_messages = 'C' # locale for system error message - # strings -#lc_monetary = 'C' # locale for monetary formatting -#lc_numeric = 'C' # locale for number formatting -#lc_time = 'C' # locale for time formatting - -# default configuration for text search -#default_text_search_config = 'pg_catalog.simple' - -# - Other Defaults - - -#dynamic_library_path = '$libdir' -#local_preload_libraries = '' - - -#------------------------------------------------------------------------------ -# LOCK MANAGEMENT -#------------------------------------------------------------------------------ - -#deadlock_timeout = 1s -#max_locks_per_transaction = 64 # min 10 - # (change requires restart) -# Note: Each lock table slot uses ~270 bytes of shared memory, and there are -# max_locks_per_transaction * (max_connections + max_prepared_transactions) -# lock table slots. -#max_pred_locks_per_transaction = 64 # min 10 - # (change requires restart) - - -#------------------------------------------------------------------------------ -# VERSION/PLATFORM COMPATIBILITY -#------------------------------------------------------------------------------ - -# - Previous PostgreSQL Versions - - -#array_nulls = on -#backslash_quote = safe_encoding # on, off, or safe_encoding -#default_with_oids = off -#escape_string_warning = on -#lo_compat_privileges = off -#quote_all_identifiers = off -#sql_inheritance = on -#standard_conforming_strings = on -#synchronize_seqscans = on - -# - Other Platforms and Clients - - -#transform_null_equals = off - - -#------------------------------------------------------------------------------ -# ERROR HANDLING -#------------------------------------------------------------------------------ - -#exit_on_error = off # terminate session on any error? -#restart_after_crash = on # reinitialize after backend crash? - - -#------------------------------------------------------------------------------ -# CONFIG FILE INCLUDES -#------------------------------------------------------------------------------ - -# These options allow settings to be loaded from files other than the -# default postgresql.conf. - -#include_dir = 'conf.d' # include files ending in '.conf' from - # directory 'conf.d' -#include_if_exists = 'exists.conf' # include file only if it exists -#include = 'special.conf' # include file - - -#------------------------------------------------------------------------------ -# CUSTOMIZED OPTIONS -#------------------------------------------------------------------------------ - -# Add settings for extensions here From ada0f9cfbb6859666ac7fb5d34777285bb497f59 Mon Sep 17 00:00:00 2001 From: fernando Date: Wed, 23 Oct 2019 11:08:27 +0200 Subject: [PATCH 06/11] Move Jenkinsfile according scenarios folder --- .../stamp/atos/{ => functional}/Jenkinsfile | 23 ++++-- .../functional/template/citygo/entrypoint.sh | 15 ++++ .../template/citygo/requirements.txt | 25 ++++++ samples/stamp/atos/performance/Jenkinsfile | 78 +++++++++++++++++++ 4 files changed, 133 insertions(+), 8 deletions(-) rename samples/stamp/atos/{ => functional}/Jenkinsfile (60%) create mode 100644 samples/stamp/atos/functional/template/citygo/entrypoint.sh create mode 100644 samples/stamp/atos/functional/template/citygo/requirements.txt create mode 100644 samples/stamp/atos/performance/Jenkinsfile diff --git a/samples/stamp/atos/Jenkinsfile b/samples/stamp/atos/functional/Jenkinsfile similarity index 60% rename from samples/stamp/atos/Jenkinsfile rename to samples/stamp/atos/functional/Jenkinsfile index 28166b1d..1ea63d0b 100644 --- a/samples/stamp/atos/Jenkinsfile +++ b/samples/stamp/atos/functional/Jenkinsfile @@ -13,14 +13,14 @@ pipeline { steps{ 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 + docker run -d -u root -i -t --name camp -v /var/run/docker.sock:/var/run/docker.sock -v /var/jenkins_home/workspace/citygo_case2_camp/:/stamp_docker_citygoApp/ -t fchauvel/camp:dev ''' } } stage('CAMP generate'){ steps{ sh ''' - docker exec -d camp sh -c 'rm /stamp_docker_citygoApp/apache/app/Dockerfile && cp -R /stamp_docker_citygoApp/apache/app/* ./samples/stamp/atos/performance/template/citygo/'; + docker exec -d camp sh -c 'rm /stamp_docker_citygoApp/apache/app/Dockerfile && cp -R /stamp_docker_citygoApp/nginx/ARTIST/app/* ./samples/stamp/atos/performance/template/citygo/'; docker exec -i camp sh -c 'cd samples/stamp/atos/performance/ && camp generate -d . --all'; exit; ''' @@ -32,8 +32,6 @@ pipeline { docker exec -i camp sh -c 'cd samples/stamp/atos/performance/ && camp realize -d . && cp -R out/ /stamp_docker_citygoApp/'; exit; ''' - zip zipFile: 'testconf.zip', archive: true, dir: '/var/jenkins_home/workspace/citygo_camp/out', glob: '**/*.yml' - zip zipFile: 'dockerfiles.zip', archive: true, dir: '/var/jenkins_home/workspace/citygo_camp/out', glob: '**/Dockerfile' } } stage('CAMP execute'){ @@ -47,7 +45,14 @@ pipeline { stage('Publish reports') { steps { script { - sh 'ls -d /var/jenkins_home/workspace/citygo_camp/out/*/ > reportDirNames.txt' + sh ''' + docker exec -i camp sh -c 'cp -R samples/stamp/atos/performance/out/* /stamp_docker_citygoApp/out/ && + cp samples/stamp/atos/performance/camp_execute.log /stamp_docker_citygoApp/ && exit'; + ls -d /var/jenkins_home/workspace/citygo_case2_camp/out/*/ > reportDirNames.txt; + exit; + ''' + zip zipFile: 'JMetterTestsLogs.zip', archive: true, dir: '/var/jenkins_home/workspace/citygo_case2_camp', glob: '**/camp_execute.log' + def reportDirectories = readFile('reportDirNames.txt').split("\\r?\\n") sh 'rm -f reportDirNames.txt' for (i = 0; i < reportDirectories.size(); i++) { @@ -55,14 +60,16 @@ pipeline { allowMissing: false, alwaysLinkToLastBuild: false, keepAll: true, - reportDir: reportDirectories[i] + '/test-reports', - reportFiles: 'index.html', + reportDir: reportDirectories[i] + '/test-reports/nginx-logs/', + reportFiles: 'error.log', reportName: reportDirectories[i].tokenize('/').last() ]) } + sh ''' + docker stop camp && docker rm camp + ''' } } } } } - diff --git a/samples/stamp/atos/functional/template/citygo/entrypoint.sh b/samples/stamp/atos/functional/template/citygo/entrypoint.sh new file mode 100644 index 00000000..3c42ade4 --- /dev/null +++ b/samples/stamp/atos/functional/template/citygo/entrypoint.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +#Starting gunicorm +echo Starting Gunicorm + +#python manage.py migrate --no-input +python manage.py collectstatic --no-input + +# Run coverage + +#coverage run manage.py test -v 2 +#coverage html +export BROWSER=firefox +exec "$@" + diff --git a/samples/stamp/atos/functional/template/citygo/requirements.txt b/samples/stamp/atos/functional/template/citygo/requirements.txt new file mode 100644 index 00000000..0505cfcb --- /dev/null +++ b/samples/stamp/atos/functional/template/citygo/requirements.txt @@ -0,0 +1,25 @@ +Django==1.10.2 +django-allauth==0.27.0 +django-rest-auth==0.8.1 +djangorestframework==3.4.7 +httplib2==0.9.2 +oauth2==1.9.0.post1 +oauthlib==2.0.0 +psycopg2 +psycopg2-binary +python-openid==2.2.5 +requests>=2.18.2 +requests-cache==0.4.12 +requests-oauthlib==0.7.0 +six==1.10.0 +pyowm==2.9.0 +unidecode +pymongo +pandas +gunicorn==19.6.0 +redis==2.10.6 +coverage==3.6 +selenium +html-testRunner==1.2 +pytest-html +unittest-xml-reporting==2.5.1 diff --git a/samples/stamp/atos/performance/Jenkinsfile b/samples/stamp/atos/performance/Jenkinsfile new file mode 100644 index 00000000..2ee4da4d --- /dev/null +++ b/samples/stamp/atos/performance/Jenkinsfile @@ -0,0 +1,78 @@ +pipeline { + + agent any + + stages { + + stage('Pull SCM sut'){ + steps{ + git (credentialsId: 'git-credentials', url: 'https://gitlab.atosresearch.eu/ari/stamp_docker_citygoApp', branch: 'master') + } + } + stage('Run CAMP'){ + steps{ + sh ''' + docker pull fchauvel/camp:dev; + docker run -d -u root -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'){ + steps{ + sh ''' + docker exec -d camp sh -c 'rm /stamp_docker_citygoApp/apache/app/Dockerfile && cp -R /stamp_docker_citygoApp/apache/app/server/* ./samples/stamp/atos/performance/template/citygo/'; + docker exec -i camp sh -c 'cd samples/stamp/atos/performance/ && camp generate -d . --all'; + exit; + ''' + } + } + stage('CAMP realize'){ + steps{ + sh ''' + docker exec -i camp sh -c 'cd samples/stamp/atos/performance/ && camp realize -d . && cp -R out/ /stamp_docker_citygoApp/'; + exit; + ''' + } + } + stage('CAMP execute'){ + steps{ + sh ''' + docker exec -i camp sh -c 'cd samples/stamp/atos/performance/ && camp execute -d .'; + exit; + ''' + } + } + stage('Publish reports') { + steps { + script { + sh ''' + docker exec -i camp sh -c 'cp -R samples/stamp/atos/performance/out/* /stamp_docker_citygoApp/out/ && + cp samples/stamp/atos/performance/camp_execute.log /stamp_docker_citygoApp/ && exit'; + ls -d /var/jenkins_home/workspace/citygo_camp/out/*/ > reportDirNames.txt; + cat /var/jenkins_home/workspace/citygo_camp/camp_execute.log | grep "Online report link" > linksPerformanceTestReports.log; + rm /var/jenkins_home/workspace/citygo_camp/camp_execute.log; + exit; + ''' + zip zipFile: 'JMetterTestsLogs.zip', archive: true, dir: '/var/jenkins_home/workspace/citygo_camp', glob: '**/linksPerformanceTestReports.log' + + def reportDirectories = readFile('reportDirNames.txt').split("\\r?\\n") + sh 'rm -f reportDirNames.txt' + for (i = 0; i < reportDirectories.size(); i++) { + publishHTML (target: [ + allowMissing: false, + alwaysLinkToLastBuild: false, + keepAll: true, + reportDir: reportDirectories[i] + '/test-reports/apache-logs/', + reportFiles: 'error.log', + reportName: reportDirectories[i].tokenize('/').last() + ]) + } + sh ''' + docker stop camp && docker rm camp + ''' + } + } + } + } +} + From 55d5c587de2932f5a48a92a92a2cdcd124fe07ca Mon Sep 17 00:00:00 2001 From: fernando Date: Thu, 24 Oct 2019 09:47:53 +0200 Subject: [PATCH 07/11] Updated according templates --- samples/stamp/atos/functional/camp.yml | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/samples/stamp/atos/functional/camp.yml b/samples/stamp/atos/functional/camp.yml index 18b5bfab..27424a3a 100644 --- a/samples/stamp/atos/functional/camp.yml +++ b/samples/stamp/atos/functional/camp.yml @@ -34,18 +34,6 @@ components: docker: image: selenium/hub - apache: - provides_services: [ HttpProxy ] - requires_services: [ CityGo ] - implementation: - docker: - file: apache/Dockerfile - realization: - - select: docker-compose-apache.yml - instead_of: - - docker-compose-nginx.yml - as: docker-compose.yml - nginx: provides_services: [ HttpProxy ] requires_services: [ CityGo ] @@ -105,17 +93,7 @@ components: postgres: provides_services: [ Postgres ] - variables: - version: - values: [v9, v10, v11] - realization: - - targets: [ "postgres/Dockerfile" ] - pattern: "FROM postgres:9.3" - replacements: - - "FROM postgres:9.3" - - "FROM postgres:10" - - "FROM postgres:11" implementation: docker: - file: postgres/Dockerfile + file: postgres:9.3 From 10db85ac75bd8d9ea1e7327afccb117cc5711820 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20M=C3=A9ndez=20Requena?= Date: Thu, 24 Oct 2019 12:53:41 +0200 Subject: [PATCH 08/11] Update Jenkinsfile --- samples/stamp/atos/performance/Jenkinsfile | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/samples/stamp/atos/performance/Jenkinsfile b/samples/stamp/atos/performance/Jenkinsfile index 2ee4da4d..c4d8a7d2 100644 --- a/samples/stamp/atos/performance/Jenkinsfile +++ b/samples/stamp/atos/performance/Jenkinsfile @@ -3,7 +3,7 @@ pipeline { agent any stages { - + stage('Pull SCM sut'){ steps{ git (credentialsId: 'git-credentials', url: 'https://gitlab.atosresearch.eu/ari/stamp_docker_citygoApp', branch: 'master') @@ -46,15 +46,20 @@ pipeline { steps { script { sh ''' - docker exec -i camp sh -c 'cp -R samples/stamp/atos/performance/out/* /stamp_docker_citygoApp/out/ && - cp samples/stamp/atos/performance/camp_execute.log /stamp_docker_citygoApp/ && exit'; + DATE=${env.BUILD_ID}; + OUT=/stamp_docker_citygoApp/out/$DATE; + mkdir -p $OUT; + docker exec -i camp sh -c 'cp -R samples/stamp/atos/performance/out/* $OUT && + cp samples/stamp/atos/performance/camp_execute.log $OUT && exit'; ls -d /var/jenkins_home/workspace/citygo_camp/out/*/ > reportDirNames.txt; cat /var/jenkins_home/workspace/citygo_camp/camp_execute.log | grep "Online report link" > linksPerformanceTestReports.log; rm /var/jenkins_home/workspace/citygo_camp/camp_execute.log; + mkdir -p $DATE; + mv /var/jenkins_home/workspace/citygo_camp/linksPerformanceTestReports.log /var/jenkins_home/workspace/citygo_camp/$DATE/; exit; ''' - zip zipFile: 'JMetterTestsLogs.zip', archive: true, dir: '/var/jenkins_home/workspace/citygo_camp', glob: '**/linksPerformanceTestReports.log' - + zip zipFile: 'JMetterTestsLogs.zip', archive: true, dir: '/var/jenkins_home/workspace/citygo_camp/${env.BUILD_ID}/', glob: '**/linksPerformanceTestReports.log' + def reportDirectories = readFile('reportDirNames.txt').split("\\r?\\n") sh 'rm -f reportDirNames.txt' for (i = 0; i < reportDirectories.size(); i++) { From 4ff3ae2becd871497c6328e8d79e567f0e86f38a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20M=C3=A9ndez=20Requena?= Date: Mon, 28 Oct 2019 12:11:35 +0100 Subject: [PATCH 09/11] Update citygo.jmx --- samples/stamp/atos/performance/template/browser/citygo.jmx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/stamp/atos/performance/template/browser/citygo.jmx b/samples/stamp/atos/performance/template/browser/citygo.jmx index 11e36ce5..6ae56d70 100755 --- a/samples/stamp/atos/performance/template/browser/citygo.jmx +++ b/samples/stamp/atos/performance/template/browser/citygo.jmx @@ -17,7 +17,7 @@ false 1 - ${__P(numThreads,50)} + ${__P(numThreads,500)} ${__P(numThreads,10)} 1528707181000 1528707181000 From 042862821b7c770ec5a97f17dc4d331ec160cbe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20M=C3=A9ndez=20Requena?= Date: Tue, 29 Oct 2019 11:06:41 +0100 Subject: [PATCH 10/11] Update Jenkinsfile --- samples/stamp/atos/performance/Jenkinsfile | 39 ++++++++++++---------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/samples/stamp/atos/performance/Jenkinsfile b/samples/stamp/atos/performance/Jenkinsfile index c4d8a7d2..4c54494d 100644 --- a/samples/stamp/atos/performance/Jenkinsfile +++ b/samples/stamp/atos/performance/Jenkinsfile @@ -3,7 +3,7 @@ pipeline { agent any stages { - + stage('Pull SCM sut'){ steps{ git (credentialsId: 'git-credentials', url: 'https://gitlab.atosresearch.eu/ari/stamp_docker_citygoApp', branch: 'master') @@ -28,12 +28,16 @@ pipeline { } stage('CAMP realize'){ steps{ - sh ''' - docker exec -i camp sh -c 'cd samples/stamp/atos/performance/ && camp realize -d . && cp -R out/ /stamp_docker_citygoApp/'; - exit; - ''' - } + script { + def BUILD_ID= "" + BUILD_ID = env.BUILD_ID + sh ''' + docker exec -i -e BUILD_ID="${BUILD_ID}" camp sh -c 'cd samples/stamp/atos/performance/ && camp realize -d .'; + ''' + } + } } + stage('CAMP execute'){ steps{ sh ''' @@ -42,23 +46,23 @@ pipeline { ''' } } + stage('Publish reports') { + steps { script { + def BUILD_ID= "" + BUILD_ID = env.BUILD_ID sh ''' - DATE=${env.BUILD_ID}; - OUT=/stamp_docker_citygoApp/out/$DATE; - mkdir -p $OUT; - docker exec -i camp sh -c 'cp -R samples/stamp/atos/performance/out/* $OUT && - cp samples/stamp/atos/performance/camp_execute.log $OUT && exit'; - ls -d /var/jenkins_home/workspace/citygo_camp/out/*/ > reportDirNames.txt; - cat /var/jenkins_home/workspace/citygo_camp/camp_execute.log | grep "Online report link" > linksPerformanceTestReports.log; - rm /var/jenkins_home/workspace/citygo_camp/camp_execute.log; - mkdir -p $DATE; - mv /var/jenkins_home/workspace/citygo_camp/linksPerformanceTestReports.log /var/jenkins_home/workspace/citygo_camp/$DATE/; + docker exec -i -e BUILD_ID="${BUILD_ID}" camp sh -c 'cd /stamp_docker_citygoApp/out/ && mkdir $BUILD_ID && + cp -R /camp/samples/stamp/atos/performance/out/* /stamp_docker_citygoApp/out/$BUILD_ID/ && exit'; + docker exec -i -e BUILD_ID="${BUILD_ID}" camp sh -c 'mv samples/stamp/atos/performance/camp_execute.log /stamp_docker_citygoApp/out/$BUILD_ID/ && exit'; + ls -d /var/jenkins_home/workspace/citygo_camp/out/$BUILD_ID/*/ > reportDirNames.txt; + cat /var/jenkins_home/workspace/citygo_camp/out/$BUILD_ID/camp_execute.log | grep "Online report link" > linksPerformanceTestReports.log; + mv /var/jenkins_home/workspace/citygo_camp/linksPerformanceTestReports.log /var/jenkins_home/workspace/citygo_camp/out/$BUILD_ID/; exit; ''' - zip zipFile: 'JMetterTestsLogs.zip', archive: true, dir: '/var/jenkins_home/workspace/citygo_camp/${env.BUILD_ID}/', glob: '**/linksPerformanceTestReports.log' + zip zipFile: 'JMetterTestsLogs.zip', archive: true, dir: '/var/jenkins_home/workspace/citygo_camp/out/$BUILD_ID/', glob: '**/linksPerformanceTestReports.log' def reportDirectories = readFile('reportDirNames.txt').split("\\r?\\n") sh 'rm -f reportDirNames.txt' @@ -80,4 +84,3 @@ pipeline { } } } - From 4da42b3ac678e4b3dceb04e4c14eb8c87f1b0166 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20M=C3=A9ndez=20Requena?= Date: Tue, 29 Oct 2019 11:58:38 +0100 Subject: [PATCH 11/11] Update Jenkinsfile --- samples/stamp/atos/performance/Jenkinsfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/stamp/atos/performance/Jenkinsfile b/samples/stamp/atos/performance/Jenkinsfile index 4c54494d..13d41453 100644 --- a/samples/stamp/atos/performance/Jenkinsfile +++ b/samples/stamp/atos/performance/Jenkinsfile @@ -55,11 +55,11 @@ pipeline { BUILD_ID = env.BUILD_ID sh ''' docker exec -i -e BUILD_ID="${BUILD_ID}" camp sh -c 'cd /stamp_docker_citygoApp/out/ && mkdir $BUILD_ID && - cp -R /camp/samples/stamp/atos/performance/out/* /stamp_docker_citygoApp/out/$BUILD_ID/ && exit'; - docker exec -i -e BUILD_ID="${BUILD_ID}" camp sh -c 'mv samples/stamp/atos/performance/camp_execute.log /stamp_docker_citygoApp/out/$BUILD_ID/ && exit'; + cp -R /camp/samples/stamp/atos/performance/out/* /stamp_docker_citygoApp/out/$BUILD_ID/ && + cp /camp/samples/stamp/atos/performance/camp_execute.log /stamp_docker_citygoApp/out/$BUILD_ID/ && exit'; ls -d /var/jenkins_home/workspace/citygo_camp/out/$BUILD_ID/*/ > reportDirNames.txt; cat /var/jenkins_home/workspace/citygo_camp/out/$BUILD_ID/camp_execute.log | grep "Online report link" > linksPerformanceTestReports.log; - mv /var/jenkins_home/workspace/citygo_camp/linksPerformanceTestReports.log /var/jenkins_home/workspace/citygo_camp/out/$BUILD_ID/; + rm /var/jenkins_home/workspace/citygo_camp/out/$BUILD_ID/camp_execute.log; exit; ''' zip zipFile: 'JMetterTestsLogs.zip', archive: true, dir: '/var/jenkins_home/workspace/citygo_camp/out/$BUILD_ID/', glob: '**/linksPerformanceTestReports.log'