Commit ff4575fc authored by Sebastian Miller's avatar Sebastian Miller
Browse files

requests CI attempt, different approach

parent 098f33ab
......@@ -59,14 +59,13 @@ integration-tests:ensembler:
- integration
services:
- $DOCKER_DIND_SERVICE
#services:
# - name: rmohr/activemq:5.15.9
# alias: activemq
# - name: influxdb:1.8.4
# alias: influxdb
# variables:
# INFLUXDB_ADMIN_USER: admin
# INFLUXDB_ADMIN_PASSWORD: admin1234
- name: rmohr/activemq:5.15.9
alias: activemq
- name: influxdb:1.8.4
alias: influxdb
variables:
INFLUXDB_ADMIN_USER: admin
INFLUXDB_ADMIN_PASSWORD: admin1234
# entrypoint: ["/bin/bash", "-c", "cp /builds/melodic/zpp-assembler/integration/system-setup/influxdb/influx_init.iql \
# /docker-entrypoint-initdb.d/influx_init.iql/"] # Volume mounting workaround
# - name: $CONTAINER_BASE_TAG:$CI_COMMIT_SHA
......@@ -76,23 +75,38 @@ integration-tests:ensembler:
# entrypoint: ["/bin/bash", "-c", "cp -R /builds/melodic/zpp-assembler/integration/ensembler_flask/tests/config/* \
# /ensembler/config/"] # Volume mounting workaround
script:
- docker container ls
- apk add --no-cache curl
#- docker exec -d influxdb 'echo "CREATE DATABASE melodic_ui; CREATE DATABASE morphemic;" | influxdb'
- curl --user admin:admin1234 -XPOST 'http://influxdb:8086/query' \
--data-urlencode 'q=CREATE DATABASE "melodic_ui"'
- curl --user admin:admin1234 -XPOST 'http://influxdb:8086/query' \
--data-urlencode 'q=CREATE DATABASE "morphemic"'
- docker load -i image/ensembler.tar # Load the artifact image
- docker run \
--env-file $ENSEMBLER_DIR/tests/config/server_params.env \
--network=host \
-v $ENSEMBLER_DIR/saved_models:/ensembler/saved_models \
-v $ENSEMBLER_DIR/logs:/ensembler/logs \
-v $ENSEMBLER_DIR/tests/config/properties.yml:/ensembler/config/properties.yml \
ensembler
- apk add --no-cache python3 py3-pip
- pip3 install --no-cache-dir docker-compose
- docker-compose -v
#- pip3 install --no-cache-dir docker-compose
#- docker-compose -v
- cd $SYSTEM_SETUP_DIR
#- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
#- docker pull $CONTAINER_BASE_TAG:$CI_COMMIT_SHA
- docker-compose --profile gitlab up -d # Run the test environment
#- docker-compose --profile gitlab up -d # Run the test environment
- cd influxdb
- chmod u+x ./fill_db.sh
- ./fill_db.sh '127.0.0.1' 'sample_data_separate_runs' # Upload test data to InfluxDB
- ./fill_db.sh 'influxdb' 'sample_data_separate_runs' # Upload test data to InfluxDB
- cd $CI_PROJECT_DIR/$ENSEMBLER_DIR
- pip3 install --no-cache-dir --upgrade pip
- pip3 install --no-cache-dir poetry
- poetry install
- ENSEMBLER_HOST_IP='127.0.0.1' poetry run pytest tests/test_requests.py # Run the test
- docker-compose stop # Stop the test environment
- docker stop ensembler
#- docker-compose stop # Stop the test environment
# Push the built and tested image
deploy:ensembler:
......
......@@ -5,7 +5,7 @@
### How to prepare the component
- Prepare the `properties.yml` file
- The default file is the `config/properties.yml` file. You can modify this one or store a modified version somewhere else. If you want to avoid rebuilding the image every time after changing the properties, it is important to mount the appropriate properties file on the host machine to the `/ensembler/properties.yml` file in the container's filesystem when running the container (using the Docker volumes functionality).
- The default file is the `config/properties.yml` file. You can modify this one or store a modified version somewhere else. If you want to avoid rebuilding the image every time after changing the properties, it is important to mount the appropriate properties file on the host machine to the `/ensembler/config/properties.yml` file in the container's filesystem when running the container (using the Docker volumes functionality).
- Prepare the `server_params.env` file
- The default file is the `config/server_params.env` file. You need to set the port on which the app is to be exposed.
- Build the component's image as you would build any other Docker image, that is using e.g.: `docker build -t ensembler .`
......@@ -24,7 +24,7 @@ docker run \
-p <host_machine_port_on_which_ensembler_is_to_be_accessible>:<ensembler_port_you've_set_in_the_server_params_file> \
-v <dir_in_which_you_wish_to_persist_ensembling_models>:/ensembler/saved_models \
-v <dir_in_which_you_wish_to_save_logs>:/ensembler/logs \
-v <path_to_your_properties_file>:/ensembler/properties.yml \
-v <path_to_your_properties_file>:/ensembler/config/properties.yml \
ensembler
```
Notice:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment