Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tango
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOFAR2.0
tango
Commits
cef15212
Commit
cef15212
authored
3 years ago
by
Jan David Mol
Browse files
Options
Downloads
Patches
Plain Diff
L2SS-677
: Store container logs as gitlab CI/CD artifacts
parent
9f891839
No related branches found
No related tags found
1 merge request
!287
L2SS-677: Save docker logs and tangodb dump as Gitlab CI artefacts
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+0
-2
0 additions, 2 deletions
.gitignore
.gitlab-ci.yml
+10
-8
10 additions, 8 deletions
.gitlab-ci.yml
sbin/run_integration_test.sh
+6
-26
6 additions, 26 deletions
sbin/run_integration_test.sh
with
16 additions
and
36 deletions
.gitignore
+
0
−
2
View file @
cef15212
...
...
@@ -27,5 +27,3 @@ tangostationcontrol/docs/build
**/pending_log_messages.db
**/.eggs
log/*.log
log/*.json
This diff is collapsed.
Click to expand it.
.gitlab-ci.yml
+
10
−
8
View file @
cef15212
...
...
@@ -448,10 +448,9 @@ integration_test_docker:
variables
:
DOCKER_TLS_CERTDIR
:
"
/certs"
artifacts
:
name
:
integration-test-logs
when
:
always
paths
:
-
$CI_PROJECT_DIR/
log/
*
-
log/
before_script
:
-
|
if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" && -z "$CI_COMMIT_TAG" ]]; then
...
...
@@ -470,20 +469,23 @@ integration_test_docker:
-
export BASH_SOURCE=$(pwd)/bootstrap/etc/lofar20rc.sh
# Hack HOSTNAME env variable into host.docker.internal, set in docker-compose
-
export HOSTNAME=host.docker.internal
# - export HOSTNAME=$(hostname -i)
# - export HOSTNAME=$(cat /run/systemd/netif/leases/2 | grep ^ADDRESS= | awk -F'=' '{print $2}')
# source the lofarrc file and mask its non zero exit code
-
. bootstrap/etc/lofar20rc.sh ||
true
# TANGO_HOST must be unset our databaseds will be unreachable
-
unset TANGO_HOST
## Allow docker image script to execute
# - chmod u+x $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh
# Do not remove 'bash' or statement will be ignored by primitive docker shell
-
bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh pull $tag
## Allow integration test to execute
# - chmod u+x $CI_PROJECT_DIR/sbin/run_integration_test.sh
# Do not remove 'bash' or statement will be ignored by primitive docker shell
-
bash $CI_PROJECT_DIR/sbin/run_integration_test.sh
after_script
:
# Collect output of all containers
-
|
mkdir -p log
for container in $(docker ps -a --format "{{.Names}}")
do
echo "Saving log for container $container"
docker logs "${container}" >& "log/${container}.log"
done
wheel_packaging
:
stage
:
packaging
artifacts
:
...
...
This diff is collapsed.
Click to expand it.
sbin/run_integration_test.sh
+
6
−
26
View file @
cef15212
...
...
@@ -9,10 +9,6 @@ if [ -z "$LOFAR20_DIR" ]; then
LOFAR20_DIR
=
$(
readlink
-f
"
${
LOFAR20_DIR_RELATIVE
}
"
)
fi
# Where to store any logs and output files we produce
ARTIFACT_DIR
=
"
${
LOFAR20_DIR
}
/log"
mkdir
-p
"
${
ARTIFACT_DIR
}
"
cd
"
$LOFAR20_DIR
/docker-compose"
||
exit
1
# Start the database server first
...
...
@@ -48,9 +44,6 @@ bash "${LOFAR20_DIR}"/sbin/update_ConfigDb.sh "${LOFAR20_DIR}"/CDB/tango-archive
bash
"
${
LOFAR20_DIR
}
"
/sbin/update_ConfigDb.sh
"
${
LOFAR20_DIR
}
"
/CDB/stations/simulators_ConfigDb.json
bash
"
${
LOFAR20_DIR
}
"
/sbin/update_ConfigDb.sh
"
${
LOFAR20_DIR
}
"
/CDB/stations/dummy_positions_ConfigDb.json
# Dump the resulting configuration for offline analysis
bash
"
${
LOFAR20_DIR
}
"
/bin/dump_ConfigDb.sh
>
&
"
${
ARTIFACT_DIR
}
"
/integration-test-ConfigDb-dump.json
cd
"
$LOFAR20_DIR
/docker-compose"
||
exit
1
# shellcheck disable=SC2086
make start
$SIMULATORS
...
...
@@ -72,24 +65,11 @@ cd "$LOFAR20_DIR/docker-compose" || exit 1
make up integration-test
# Run the default integration tests
TEST_RESULT
=
0
make run integration-test default
||
TEST_RESULT
=
$?
make run integration-test default
if
[
${
TEST_RESULT
}
-eq
0
]
then
# Configure integration test for recv_cluster module
bash
"
${
LOFAR20_DIR
}
"
/sbin/update_ConfigDb.sh
"
${
LOFAR20_DIR
}
"
/CDB/integrations/recvcluster_ConfigDb.json
make restart device-recv device-tilebeam
sleep
5
TEST_RESULT
=
0
make run integration-test recv_cluster
||
TEST_RESULT
=
$?
fi
# Dump logs of important containers
for
container
in
$DEVICES
databaseds dsconfig tangodb
do
docker logs
"
${
CONTAINER_NAME_PREFIX
}${
container
}
"
>
&
"
${
ARTIFACT_DIR
}
/
${
container
}
.log"
done
exit
$TEST_RESULT
make run integration-test recv_cluster
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment