Skip to content
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
22 changes: 17 additions & 5 deletions ci-operator/config/cri-o/cri-o/cri-o-cri-o-main__ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,26 @@ base_images:
name: test
namespace: ocp-kni
tag: dev-scripts
openshift_release_golang-1.18:
name: release
namespace: openshift
tag: golang-1.18
binary_build_commands: "echo \"no build commands\" \n"
build_root:
image_stream_tag:
name: release
namespace: openshift
tag: golang-1.18
images:
- dockerfile_literal: |
FROM base
FROM registry.fedoraproject.org/fedora:36
RUN curl https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz > /tmp/google-cloud-sdk.tar.gz
RUN mkdir -p /usr/local/gcloud \
&& tar -C /usr/local/gcloud -xvf /tmp/google-cloud-sdk.tar.gz \
&& /usr/local/gcloud/google-cloud-sdk/install.sh \
&& rm -f /tmp/google-cloud-sdk.tar.gz
ENV PATH $PATH:/usr/local/gcloud/google-cloud-sdk/bin
WORKDIR /src
COPY . .
from: src
to: crio-crio-base-src
Expand All @@ -29,19 +41,19 @@ resources:
requests:
cpu: 100m
memory: 200Mi
test_binary_build_commands: "echo \"asdf\" \n"
test_binary_build_commands: "echo \"no test commands\" \n"
tests:
- as: e2e
steps:
cluster_profile: equinix-ocp-metal
cluster_profile: gcp
workflow: cri-o-e2e
- as: integration
steps:
cluster_profile: equinix-ocp-metal
cluster_profile: gcp
workflow: cri-o-integration
- as: critest
steps:
cluster_profile: equinix-ocp-metal
cluster_profile: gcp
workflow: cri-o-critest
zz_generated_metadata:
branch: main
Expand Down
42 changes: 27 additions & 15 deletions ci-operator/jobs/cri-o/cri-o/cri-o-cri-o-main-presubmits.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ presubmits:
branches:
- ^main$
- ^main-
cluster: build04
cluster: build02
context: ci/prow/ci-critest
decorate: true
decoration_config:
skip_cloning: true
labels:
ci-operator.openshift.io/cloud: equinix-ocp-metal
ci-operator.openshift.io/cloud-cluster-profile: equinix-ocp-metal
ci-operator.openshift.io/cloud: gcp
ci-operator.openshift.io/cloud-cluster-profile: gcp
ci-operator.openshift.io/variant: ci
ci.openshift.io/generator: prowgen
pj-rehearse.openshift.io/can-be-rehearsed: "true"
Expand Down Expand Up @@ -83,8 +83,12 @@ presubmits:
secret:
secretName: ci-pull-credentials
- name: cluster-profile
secret:
secretName: cluster-secrets-equinix-ocp-metal
projected:
sources:
- secret:
name: cluster-secrets-gcp
- configMap:
name: cluster-profile-gcp
- name: pull-secret
secret:
secretName: registry-pull-credentials
Expand All @@ -97,14 +101,14 @@ presubmits:
branches:
- ^main$
- ^main-
cluster: build04
cluster: build02
context: ci/prow/ci-e2e
decorate: true
decoration_config:
skip_cloning: true
labels:
ci-operator.openshift.io/cloud: equinix-ocp-metal
ci-operator.openshift.io/cloud-cluster-profile: equinix-ocp-metal
ci-operator.openshift.io/cloud: gcp
ci-operator.openshift.io/cloud-cluster-profile: gcp
ci-operator.openshift.io/variant: ci
ci.openshift.io/generator: prowgen
pj-rehearse.openshift.io/can-be-rehearsed: "true"
Expand Down Expand Up @@ -159,8 +163,12 @@ presubmits:
secret:
secretName: ci-pull-credentials
- name: cluster-profile
secret:
secretName: cluster-secrets-equinix-ocp-metal
projected:
sources:
- secret:
name: cluster-secrets-gcp
- configMap:
name: cluster-profile-gcp
- name: pull-secret
secret:
secretName: registry-pull-credentials
Expand Down Expand Up @@ -224,14 +232,14 @@ presubmits:
branches:
- ^main$
- ^main-
cluster: build04
cluster: build02
context: ci/prow/ci-integration
decorate: true
decoration_config:
skip_cloning: true
labels:
ci-operator.openshift.io/cloud: equinix-ocp-metal
ci-operator.openshift.io/cloud-cluster-profile: equinix-ocp-metal
ci-operator.openshift.io/cloud: gcp
ci-operator.openshift.io/cloud-cluster-profile: gcp
ci-operator.openshift.io/variant: ci
ci.openshift.io/generator: prowgen
pj-rehearse.openshift.io/can-be-rehearsed: "true"
Expand Down Expand Up @@ -286,8 +294,12 @@ presubmits:
secret:
secretName: ci-pull-credentials
- name: cluster-profile
secret:
secretName: cluster-secrets-equinix-ocp-metal
projected:
sources:
- secret:
name: cluster-secrets-gcp
- configMap:
name: cluster-profile-gcp
- name: pull-secret
secret:
secretName: registry-pull-credentials
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
workflow:
as: cri-o-critest
steps:
cluster_profile: equinix-ocp-metal
cluster_profile: gcp
pre:
- ref: baremetalds-packet-setup
- ref: gcp-provision-vpc
- ref: gcp-provision-buildhost
test:
- ref: cri-o-critest-test
post:
- ref: cri-o-critest-gather
- ref: baremetalds-packet-teardown
- ref: gcp-deprovision-buildhost
env:
PACKET_PLAN: "c3.small.x86"
PACKET_OS: "rocky_8"
IMAGE_PROJECT: "rocky-linux-cloud"
IMAGE_FAMILY: "rocky-linux-8"
documentation: |-
This workflow executes the subsystem test suite on a cluster provisioned by running assisted-installer-crio-test on a packet server.
This workflow executes the subsystem test suite on a cluster provisioned by running assisted-installer-crio-test on a GCP server.
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,39 @@
set -o nounset
set -o errexit
set -o pipefail
set -x

echo "gathering logs"
# shellcheck source=/dev/null
source "${SHARED_DIR}/packet-conf.sh"
source "${SHARED_DIR}/env"

#####################################
###############Log In################
#####################################

GOOGLE_PROJECT_ID="$(< ${CLUSTER_PROFILE_DIR}/openshift_gcp_project)"
export GCP_SHARED_CREDENTIALS_FILE="${CLUSTER_PROFILE_DIR}/gce.json"
sa_email=$(jq -r .client_email ${GCP_SHARED_CREDENTIALS_FILE})
if ! gcloud auth list | grep -E "\*\s+${sa_email}"
then
gcloud auth activate-service-account --key-file="${GCP_SHARED_CREDENTIALS_FILE}"
gcloud config set project "${GOOGLE_PROJECT_ID}"
fi

mkdir -p "${HOME}"/.ssh
chmod 0700 "${HOME}"/.ssh

cp "${CLUSTER_PROFILE_DIR}"/ssh-privatekey "${HOME}"/.ssh/google_compute_engine
chmod 0600 "${HOME}"/.ssh/google_compute_engine
cp "${CLUSTER_PROFILE_DIR}"/ssh-publickey "${HOME}"/.ssh/google_compute_engine.pub

#####################################
#####################################

instance_name=$(<"${SHARED_DIR}/gcp-instance-ids.txt")

function getlogs() {
echo "### Downloading logs..."
scp -r "${SSHOPTS[@]}" "root@${IP}:/tmp/artifacts/*" "${ARTIFACT_DIR}"
gcloud compute scp --recurse --zone "${ZONE}" "${instance_name}:/tmp/artifacts/*" "${ARTIFACT_DIR}"
}

# Gather logs regardless of what happens after this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,62 @@
set -o nounset
set -o errexit
set -o pipefail
set -x

# shellcheck source=/dev/null
source "${SHARED_DIR}/packet-conf.sh"
echo "${IP}"
echo "${SSHOPTS[@]}"

tar -czf - . | ssh "${SSHOPTS[@]}" "root@${IP}" "cat > /root/cri-o.tar.gz"
timeout --kill-after 10m 120m ssh "${SSHOPTS[@]}" "root@${IP}" bash - << EOF
export HOME=/root
mkdir /tmp/artifacts
mkdir /logs
mkdir /logs/artifacts
mkdir /tmp/artifacts/logs

dnf install python39 -y
source "${SHARED_DIR}/env"

#####################################
###############Log In################
#####################################

GOOGLE_PROJECT_ID="$(< ${CLUSTER_PROFILE_DIR}/openshift_gcp_project)"
export GCP_SHARED_CREDENTIALS_FILE="${CLUSTER_PROFILE_DIR}/gce.json"
sa_email=$(jq -r .client_email ${GCP_SHARED_CREDENTIALS_FILE})
if ! gcloud auth list | grep -E "\*\s+${sa_email}"
then
gcloud auth activate-service-account --key-file="${GCP_SHARED_CREDENTIALS_FILE}"
gcloud config set project "${GOOGLE_PROJECT_ID}"
fi

mkdir -p "${HOME}"/.ssh
chmod 0700 "${HOME}"/.ssh

cp "${CLUSTER_PROFILE_DIR}"/ssh-privatekey "${HOME}"/.ssh/google_compute_engine
chmod 0600 "${HOME}"/.ssh/google_compute_engine
cp "${CLUSTER_PROFILE_DIR}"/ssh-publickey "${HOME}"/.ssh/google_compute_engine.pub

latest="v3.5.4"
if gcloud alpha storage ls gs://crio-ci | grep -q ${latest} ; then
echo "etcd is up to date"
else
echo "caching etcd"
curl https://github.com/coreos/etcd/releases/download/${latest}/etcd-${latest}-linux-amd64.tar.gz -L | gsutil cp - gs://crio-ci/etcd-${latest}.tar.gz
fi

#####################################
#####################################

instance_name=$(<"${SHARED_DIR}/gcp-instance-ids.txt")

tar -czf - . | gcloud compute ssh --zone="${ZONE}" ${instance_name} -- "cat > \${HOME}/cri-o.tar.gz"
timeout --kill-after 10m 400m gcloud compute ssh --zone="${ZONE}" ${instance_name} -- bash - << EOF
export GOROOT=/usr/local/go
echo GOROOT="/usr/local/go" | sudo tee -a /etc/environment
mkdir -p \${HOME}/logs/artifacts
mkdir -p /tmp/artifacts/logs

sudo dnf install python39 -y
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3.9 get-pip.py
python3.9 -m pip install ansible

# setup the directory where the tests will the run
REPO_DIR="/root/cri-o"
REPO_DIR="/home/deadbeef/cri-o"
mkdir -p "\${REPO_DIR}"
# NVMe makes it faster
NVME_DEVICE="/dev/nvme0n1"
if [ -e "\$NVME_DEVICE" ];
then
mkfs.xfs -f "\${NVME_DEVICE}"
mount "\${NVME_DEVICE}" "\${REPO_DIR}"
fi
# copy the agent sources on the remote machine
tar -xzvf cri-o.tar.gz -C "\${REPO_DIR}"
chown -R root:root "\${REPO_DIR}"
cd "\${REPO_DIR}/contrib/test/ci"
echo "localhost" >> hosts
ansible-playbook critest-main.yml -i hosts -e "TEST_AGENT=prow" --connection=local -vvv
EOF

13 changes: 7 additions & 6 deletions ci-operator/step-registry/cri-o/e2e/cri-o-e2e-workflow.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
workflow:
as: cri-o-e2e
steps:
cluster_profile: equinix-ocp-metal
cluster_profile: gcp
pre:
- ref: baremetalds-packet-setup
- ref: gcp-provision-vpc
- ref: gcp-provision-buildhost
test:
- ref: cri-o-e2e-test
post:
- ref: cri-o-e2e-gather
- ref: baremetalds-packet-teardown
- ref: gcp-deprovision-buildhost
env:
PACKET_PLAN: "c3.small.x86"
PACKET_OS: "rocky_8"
IMAGE_PROJECT: "rocky-linux-cloud"
IMAGE_FAMILY: "rocky-linux-8"
documentation: |-
This workflow executes the subsystem test suite on a cluster provisioned by running assisted-installer-crio-test on a packet server.
This workflow executes the subsystem test suite on a cluster provisioned by running assisted-installer-crio-test on a GCP server.
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,39 @@
set -o nounset
set -o errexit
set -o pipefail
set -x

echo "gathering logs"
# shellcheck source=/dev/null
source "${SHARED_DIR}/packet-conf.sh"
source "${SHARED_DIR}/env"

#####################################
###############Log In################
#####################################

GOOGLE_PROJECT_ID="$(< ${CLUSTER_PROFILE_DIR}/openshift_gcp_project)"
export GCP_SHARED_CREDENTIALS_FILE="${CLUSTER_PROFILE_DIR}/gce.json"
sa_email=$(jq -r .client_email ${GCP_SHARED_CREDENTIALS_FILE})
if ! gcloud auth list | grep -E "\*\s+${sa_email}"
then
gcloud auth activate-service-account --key-file="${GCP_SHARED_CREDENTIALS_FILE}"
gcloud config set project "${GOOGLE_PROJECT_ID}"
fi

mkdir -p "${HOME}"/.ssh
chmod 0700 "${HOME}"/.ssh

cp "${CLUSTER_PROFILE_DIR}"/ssh-privatekey "${HOME}"/.ssh/google_compute_engine
chmod 0600 "${HOME}"/.ssh/google_compute_engine
cp "${CLUSTER_PROFILE_DIR}"/ssh-publickey "${HOME}"/.ssh/google_compute_engine.pub

#####################################
#####################################

instance_name=$(<"${SHARED_DIR}/gcp-instance-ids.txt")

function getlogs() {
echo "### Downloading logs..."
scp -r "${SSHOPTS[@]}" "root@${IP}:/tmp/artifacts/*" "${ARTIFACT_DIR}"
gcloud compute scp --recurse --zone "${ZONE}" --recurse "${instance_name}:/tmp/artifacts/*" "${ARTIFACT_DIR}"
}

# Gather logs regardless of what happens after this
Expand Down
Loading