Skip to content

Commit

Permalink
test: fix CI
Browse files Browse the repository at this point in the history
build from podman images instead of locally
clean up some dead code in packer
drop the cri-o integration tests (for now, hopefully)

Signed-off-by: Peter Hunt <[email protected]>
  • Loading branch information
haircommander committed Aug 21, 2020
1 parent 5a6b2ac commit 7ab6aa1
Show file tree
Hide file tree
Showing 15 changed files with 19 additions and 778 deletions.
122 changes: 14 additions & 108 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ env:
ENVLIB: ".bash_profile"
GOPATH: "/var/tmp/go"
PATH: "${PATH}:${GOPATH}"
IMAGE_PROJECT: "libpod-218412"
CRIO_REPO: "https://github.com/cri-o/cri-o.git"
CRIO_SLUG: "github.com/cri-o/cri-o"
CONMON_SLUG: "github.com/containers/conmon"
Expand All @@ -19,29 +20,14 @@ env:
CIRRUS_SHELL: "/bin/bash"
# Save a little typing (path relative to $CIRRUS_WORKING_DIR)
SCRIPT_BASE: "./contrib/cirrus"
PACKER_BASE: "./contrib/cirrus/packer"
# Spoof self as travis, as cirrus has the same test issues as travis does
TRAVIS: "true"
FEDORA_CONTAINER_FQIN: "registry.fedoraproject.org/fedora:32"
PRIOR_FEDORA_CONTAINER_FQIN: "registry.fedoraproject.org/fedora:31"

####
#### Image names to test with
###
FEDORA_CACHE_IMAGE_NAME: 'fedora-29-conmon-75ea13be'
FEDORA_CONTAINER_FQIN: 'registry.fedoraproject.org/fedora:29'
PRIOR_FEDORA_CONTAINER_FQIN: 'registry.fedoraproject.org/fedora:28'

####
#### Variables for composing new cache-images (used in PR testing) from
#### base-images (pre-existing in GCE)
####
# CSV of cache-image names to build (see $PACKER_BASE/libpod_images.json)
PACKER_BUILDS: "fedora-29"
# Version of packer to use
PACKER_VER: "1.3.5"
# Manually produced base-image names (see $SCRIPT_BASE/README.md)
FEDORA_BASE_IMAGE: "fedora-cloud-base-29-1-2-1547237869"
# Special image w/ nested-libvirt + tools for creating new cache and base images
IMAGE_BUILDER_CACHE_IMAGE_NAME: "image-builder-image-1547237869"
# VM Images are maintained in the libpod repo.
_BUILT_IMAGE_SUFFIX: "podman-6530021898584064"
FEDORA_CACHE_IMAGE_NAME: "fedora-32-${_BUILT_IMAGE_SUFFIX}"

####
#### Credentials and other secret-sauces, decrypted at runtime when authorized.
Expand All @@ -58,36 +44,18 @@ env:
# and storage.
gcp_credentials: ENCRYPTED[13e51806369f650e6ccc326338deeb3c24052fc0a7be29beef2b96da551aed3200abbb6c6406a936bb4388fb2758405c]

# Default compute settings unless overridden within tasks (below)
gce_instance: {"image_project": "conmon-222014", "zone": "us-central1-f", "cpu": 4, "memory": "16Gb", "disk": 200, "image_name": "no-image-specified-in-task"}
# Default VM to use unless set or modified by task
gce_instance:
image_project: "${IMAGE_PROJECT}"
zone: "us-central1-c" # Required by Cirrus for the time being
cpu: 2
memory: "4Gb"
disk: 200 # Required for performance reasons
image_name: "${FEDORA_CACHE_IMAGE_NAME}"

# Default timeout for each task
timeout_in: '120m'

# Every *_task runs in parallel in separate VMs. The name prefix only for reference
# in WebUI, and will be followed by matrix details. This task runs the integration
# testing for every platform
cri-o_integration_task:

depends_on:
- 'config'
- 'fmt'

gce_instance:
# Generate multiple parallel tasks, covering all possible
# 'matrix' combinations.
matrix:
# Images are generated separately, from build_images_task (below)
image_name: "${FEDORA_CACHE_IMAGE_NAME}"

env:
matrix:
TEST_USERNS: 0
TEST_USERNS: 1

setup_environment_script: '$SCRIPT_BASE/setup_environment.sh'
integration_test_script: '$SCRIPT_BASE/cri-o_test.sh'

# this task runs the conmon integration tests
integration_task:

Expand Down Expand Up @@ -162,68 +130,6 @@ fmt_task:
- make fmt
- ./hack/tree_status.sh

# Test building of new cache-images for future PR testing, in this PR.
# Output images will be stored only for a very short time, then automatically deleted.
test_cache_images_task:

only_if: >-
$CIRRUS_BRANCH != 'master' &&
$CIRRUS_CHANGE_MESSAGE =~ '.*\*\*\*\s*CIRRUS:\s*TEST\s*IMAGES\s*\*\*\*.*'
# VMs created by packer are not cleaned up by cirrus, must allow task to complete
auto_cancellation: $CI != "true"

gce_instance:
image_name: "${IMAGE_BUILDER_CACHE_IMAGE_NAME}"
cpu: 4
memory: "4Gb"
disk: 200
# Additional permissions for building GCE images, within a GCE VM
scopes:
- 'compute'
- 'devstorage.full_control'

env:
IMAGE_BUILD: 1

setup_environment_script: '$SCRIPT_BASE/setup_environment.sh'
cache_images_script: '$SCRIPT_BASE/build_vm_images.sh'


# Build new cache-images for future PR testing, but only after a PR merge.
# The cache-images save install/setup time needed test every PR. The 'active'
# images are selected manually by updating the 'image_name' values above.
cache_images_task:

# Only produce new cache-images after a PR merge, and if a magic string
# is present in the most recent commit-message.
only_if: >-
$CIRRUS_BRANCH == 'master' &&
$CIRRUS_CHANGE_MESSAGE =~ '.*\*\*\*\s*CIRRUS:\s*REBUILD\s*IMAGES\s*\*\*\*.*'
# Require tests to pass first.
depends_on:
- "integration"

# VMs created by packer are not cleaned up by cirrus
auto_cancellation: $CI != "true"

gce_instance:
image_name: "${IMAGE_BUILDER_CACHE_IMAGE_NAME}"
cpu: 4
memory: "4Gb"
disk: 200
# Additional permissions for building GCE images, within a GCE VM
scopes:
- 'compute'
- 'devstorage.full_control'

env:
IMAGE_BUILD: 1

setup_environment_script: '$SCRIPT_BASE/setup_environment.sh'
cache_images_script: '$SCRIPT_BASE/build_vm_images.sh'

# Build the static binary
static_binary_task:
depends_on:
Expand Down
72 changes: 0 additions & 72 deletions contrib/cirrus/build_vm_images.sh

This file was deleted.

2 changes: 1 addition & 1 deletion contrib/cirrus/cri-o_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ OS_RELEASE_VER $OS_RELEASE_VER

cd "$CRIO_SRC"
case "$OS_REL_VER" in
fedora-29)
fedora-32)
PATCH="$SRC/$SCRIPT_BASE/network_bats.patch"
cd "$CRIO_SRC"
echo "WARNING: Applying $PATCH"
Expand Down
4 changes: 3 additions & 1 deletion contrib/cirrus/integration_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ req_env_var "
dnf install -y make glib2-devel git gcc golang
setup_gopath
cd $CIRRUS_WORKING_DIR
# the || true is to make this call idempotent, in case we already have initialized the module
go mod init || true
GOCACHE=/tmp/go-build make vendor
make
make install PREFIX=/usr # currently, the conmon location is hardcoded to /usr/bin/conmon
GOCACHE=/tmp/go-build make vendor
make test
2 changes: 0 additions & 2 deletions contrib/cirrus/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export HOME="$(getent passwd $USER | cut -d : -f 6)"
ENVLIB=${ENVLIB:-.bash_profile}
CIRRUS_WORKING_DIR="${CIRRUS_WORKING_DIR:-/var/tmp/go/src/github.com/containers/libpod}"
SCRIPT_BASE=${SCRIPT_BASE:-./contrib/cirrus}
PACKER_BASE=${PACKER_BASE:-./contrib/cirrus/packer}
CIRRUS_REPO_NAME=${CIRRUS_REPO_NAME-$(dirname $0)}
CIRRUS_BUILD_ID=${CIRRUS_BUILD_ID:-DEADBEEF} # a human
CIRRUS_BASE_SHA=${CIRRUS_BASE_SHA:-HEAD}
Expand Down Expand Up @@ -80,7 +79,6 @@ CIRRUS_USER_PERMISSION $CIRRUS_USER_PERMISSION
CIRRUS_WORKING_DIR $CIRRUS_WORKING_DIR
CIRRUS_HTTP_CACHE_HOST $CIRRUS_HTTP_CACHE_HOST
$(go env)
PACKER_BUILDS $PACKER_BUILDS
" | while read NAME VALUE
do
[[ -z "$NAME" ]] || echo "export $NAME=\"$VALUE\""
Expand Down
4 changes: 0 additions & 4 deletions contrib/cirrus/packer/.gitignore

This file was deleted.

Loading

0 comments on commit 7ab6aa1

Please sign in to comment.