Skip to content

Commit

Permalink
Testing different tags
Browse files Browse the repository at this point in the history
  • Loading branch information
viroel committed Oct 28, 2022
1 parent 5fe709d commit 80902c9
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 94 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,22 @@ base_images:
namespace: ci
tag: v1.46.0
binary_build_commands: |
env
# Build mariadb-operator
cd /go/src/github.com/openstack-k8s-operators/mariadb-operator
unset GOFLAGS
export OS_REGISTRY=registry.build04.ci.openshift.org
export IMAGE_TAG_BASE=${OS_REGISTRY}/${OPENSHIFT_BUILD_NAMESPACE}/pipeline
export BUNDLE_IMG=${IMAGE_TAG_BASE}:mariadb-operator-bundle
sed -i 's/--version $(VERSION)//' Makefile
IMG=${IMAGE_TAG_BASE}:mariadb-operator make manifests build bundle
opm index add --bundles ${BUNDLE_IMG} --out-dockerfile index.Dockerfile --generate --permissive
OS_REGISTRY=quay.io
OS_REPO=dviroel
IMAGE_TAG_BASE=${OS_REGISTRY}/${OS_REPO}/mariadb-operator
IMG=$IMAGE_TAG_BASE:${OPENSHIFT_BUILD_COMMIT}
make build bundle
# Clone and build openstack-operator
git clone https://github.com/openstack-k8s-operators/openstack-operator.git
cd openstack-operator/
IMAGE_TAG_BASE=${OS_REGISTRY}/${OS_REPO}/openstack-operator
IMG=$IMAGE_TAG_BASE:${OPENSHIFT_BUILD_COMMIT}
go work init . apis/
go work use ../ ../api/
make build bundle
build_root:
project_image:
dockerfile_literal: |
Expand Down Expand Up @@ -55,13 +63,14 @@ images:
- destination_dir: .
source_path: /go/src/github.com/openstack-k8s-operators/mariadb-operator/.
to: mariadb-operator-bundle
- dockerfile_path: index.Dockerfile
- dockerfile_path: Dockerfile
context_dir: ./openstack-operator
inputs:
bin:
paths:
- destination_dir: .
source_path: /go/src/github.com/openstack-k8s-operators/mariadb-operator/.
to: mariadb-operator-index
to: openstack-operator
releases:
latest:
integration:
Expand All @@ -75,6 +84,10 @@ resources:
requests:
cpu: 100m
memory: 200Mi
bin:
requests:
cpu: 500m
memory: 2Gi
tests:
- as: unit
commands: make gotest
Expand All @@ -101,16 +114,6 @@ tests:
commands: make gofmt || true
container:
from: src
- as: mariadb-operator-e2e
cluster_claim:
architecture: amd64
cloud: vexxhost
owner: openstack-k8s-operators
product: ocp
timeout: 1h0m0s
version: "4.10"
steps:
workflow: openstack-k8s-operators-mariadb-e2e
zz_generated_metadata:
branch: master
org: openstack-k8s-operators
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ presubmits:
branches:
- ^master$
- ^master-
cluster: build04
cluster: build05
context: ci/prow/images
decorate: true
decoration_config:
Expand Down Expand Up @@ -245,69 +245,6 @@ presubmits:
secret:
secretName: result-aggregator
trigger: (?m)^/test( | .* )images,?($|\s.*)
- agent: kubernetes
always_run: true
branches:
- ^master$
- ^master-
cluster: build04
context: ci/prow/mariadb-operator-e2e
decorate: true
decoration_config:
skip_cloning: true
labels:
ci.openshift.io/generator: prowgen
pj-rehearse.openshift.io/can-be-rehearsed: "true"
name: pull-ci-openstack-k8s-operators-mariadb-operator-master-mariadb-operator-e2e
rerun_command: /test mariadb-operator-e2e
spec:
containers:
- args:
- --gcs-upload-secret=/secrets/gcs/service-account.json
- --hive-kubeconfig=/secrets/hive-hive-credentials/kubeconfig
- --image-import-pull-secret=/etc/pull-secret/.dockerconfigjson
- --report-credentials-file=/etc/report/credentials
- --secret-dir=/secrets/ci-pull-credentials
- --target=mariadb-operator-e2e
command:
- ci-operator
image: ci-operator:latest
imagePullPolicy: Always
name: ""
resources:
requests:
cpu: 10m
volumeMounts:
- mountPath: /secrets/ci-pull-credentials
name: ci-pull-credentials
readOnly: true
- mountPath: /secrets/gcs
name: gcs-credentials
readOnly: true
- mountPath: /secrets/hive-hive-credentials
name: hive-hive-credentials
readOnly: true
- mountPath: /etc/pull-secret
name: pull-secret
readOnly: true
- mountPath: /etc/report
name: result-aggregator
readOnly: true
serviceAccountName: ci-operator
volumes:
- name: ci-pull-credentials
secret:
secretName: ci-pull-credentials
- name: hive-hive-credentials
secret:
secretName: hive-hive-credentials
- name: pull-secret
secret:
secretName: registry-pull-credentials
- name: result-aggregator
secret:
secretName: result-aggregator
trigger: (?m)^/test( | .* )mariadb-operator-e2e,?($|\s.*)
- agent: kubernetes
always_run: true
branches:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,51 @@

set -ex

#DEBUG
env
# Setup temp quay registry credentials
mkdir -p "$HOME/.docker"
REGISTRY_TOKEN_FILE="/secrets/docker/config.json"
cp "${REGISTRY_TOKEN_FILE}" "$HOME/.docker/config.json"
export OS_REGISTRY=quay.io
export OS_REPO=dviroel

mkdir -p "$HOME/.local"
export XDG_RUNTIME_DIR="$HOME/.local"

cp -r /go/src/github.com/openstack-k8s-operators/mariadb-operator/ $HOME

export IMAGE_TAG_BASE=${OS_REGISTRY}/${OS_REPO}/mariadb-operator
export VERSION=0.0.2
export IMG=$IMAGE_TAG_BASE:v$VERSION

mkdir -p "$HOME/bin"
curl -L --retry 5 https://github.com/opencontainers/umoci/releases/download/v0.4.7/umoci.amd64 -o "$HOME/bin/umoci" && chmod +x "$HOME/bin/umoci"
export PATH=$PATH:$HOME/bin

skopeo copy docker://${MARIADB_OPERATOR} docker://${OS_REGISTRY}/${OS_REPO}/mariadb-operator:${OPENSHIFT_BUILD_COMMIT}
skopeo copy docker://${MARIADB_OPERATOR_BUNDLE} docker://${OS_REGISTRY}/${OS_REPO}/mariadb-operator-bundle:${OPENSHIFT_BUILD_COMMIT}

cd $HOME/mariadb-operator
opm index add \
--bundles "${OS_REGISTRY}/${OS_REPO}/mariadb-operator-bundle:${OPENSHIFT_BUILD_COMMIT}" \
--out-dockerfile index.Dockerfile \
--generate

skopeo copy "docker://quay.io/operator-framework/opm:latest" oci:opm:latest
umoci unpack --rootless --image opm:latest index
mv database index/rootfs/
umoci repack --image opm:index index

umoci config --config.label 'operators.operatorframework.io.index.database.v1=/database/index.db' --image opm:index
umoci config --config.exposedports "50051" --image opm:index
umoci config --config.entrypoint "/bin/opm" --image opm:index
umoci config --config.cmd "registry" \
--config.cmd "serve" \
--config.cmd "--database" \
--config.cmd "/database/index.db" \
--image opm:index

skopeo copy oci:opm:index docker://${OS_REGISTRY}/${OS_REPO}/mariadb-operator-index:${OPENSHIFT_BUILD_COMMIT}

# Get install_yamls
cd $HOME
rm -rf install_yamls
git clone https://github.com/openstack-k8s-operators/install_yamls.git
Expand All @@ -18,16 +59,13 @@ sleep 5
# Creates storage needed for mariadb
make crc_storage
sleep 20
# DEBUG
sleep 7200
# Deploy mariadb operator
make mariadb MARIADB_IMG=${MARIADB_OPERATOR_INDEX}
sleep 160
make mariadb MARIADB_IMG=${OS_REGISTRY}/${OS_REPO}/mariadb-operator-index:${OPENSHIFT_BUILD_COMMIT}
sleep 120
# Deploy mariadb service
make mariadb_deploy
sleep 120
# Get all resources
oc get all
# Show mariadb databases
oc exec -it pod/mariadb-openstack -- mysql -uroot -p12345678 -e "show databases;"
sleep 1800
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ref:
as: openstack-k8s-operators-mariadb-e2e
from: src
from: bin
commands: openstack-k8s-operators-mariadb-e2e-commands.sh
resources:
requests:
Expand All @@ -11,7 +11,9 @@ ref:
name: pipeline:mariadb-operator
- env: MARIADB_OPERATOR_BUNDLE
name: pipeline:mariadb-operator-bundle
- env: MARIADB_OPERATOR_INDEX
name: pipeline:mariadb-operator-index
credentials:
- mount_path: /secrets/docker
name: quay-dviroel-robot
namespace: test-credentials
documentation: |-
This is a test step to install mariadb operator and do some basic tests.

0 comments on commit 80902c9

Please sign in to comment.