Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buildkite: Cleanup env #2146

Merged
merged 2 commits into from
Nov 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .buildkite/acceptance.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash

for test in ./acceptance/*_acceptance; do
echo "- label: ${test}"
echo " command:"
Expand Down
9 changes: 9 additions & 0 deletions .buildkite/clean_env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

cntrs="$(docker ps -aq)"
[ -n "$cntrs" ] && { echo "Remove leftover containers: $cntrs"; docker rm -f "$cntrs"; }

echo "Remove leftover networks"
docker network prune -f
echo "Remove leftover volumes"
docker volume prune -f
3 changes: 3 additions & 0 deletions .buildkite/common.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash

set -e

if [ "$BUILDKITE_PULL_REQUEST" == "false" ]; then
Expand All @@ -13,3 +15,4 @@ echo "env:"
echo " SCION_MOUNT: /tmp/scion_out.$BUILDKITE_BUILD_NUMBER"
echo " SCION_CNTR: scion_ci_$BUILDKITE_BUILD_NUMBER"
echo " ARTIFACTS: buildkite.${BUILDKITE_ORGANIZATION_SLUG}.${TARGET}.${BUILD}"
echo " BASE: $BASE"
2 changes: 2 additions & 0 deletions .buildkite/integration.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash

set -e

echo "- label: Integration Tests"
Expand Down
1 change: 1 addition & 0 deletions .buildkite/setup.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
- label: Prepare scion_base and scion images
command:
- $BASE/clean_env.sh
- ./tools/ci/prepare_image 12897905098b25a493ecf876d0a3ab355521d0f2e8044eae3c0cfda8714b7339
- ./docker.sh build
concurrency: 1
Expand Down
1 change: 1 addition & 0 deletions .buildkite/teardown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
- label: Stop container
command:
- ./docker.sh stop
- $BASE/clean_env.sh
4 changes: 2 additions & 2 deletions python/topology/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ def _sciond_conf(self, topo_id, base):
image = 'scion_sciond_py' if self.args.sciond == 'py' else 'scion_sciond'
entry = {
'image': image,
'container_name': name,
'container_name': '%ssd%s' % (self.prefix, topo_id.file_fmt()),
'depends_on': [
'scion_disp_%s' % topo_id.file_fmt()
],
Expand All @@ -328,7 +328,7 @@ def _sciond_conf(self, topo_id, base):
self.dc_conf['services'][name] = entry

def _sciond_name(self, topo_id):
return '%ssd%s' % (self.prefix, topo_id.file_fmt())
return 'scion_sd%s' % topo_id.file_fmt()

def _disp_vol(self, topo_id):
return 'vol_%sdisp_%s:/run/shm/dispatcher:rw' % (self.prefix, topo_id.file_fmt())
Expand Down