Skip to content

Commit

Permalink
add support for build lpt container
Browse files Browse the repository at this point in the history
Signed-off-by: Tiago Bueno <49003339+tlbueno@users.noreply.github.com>
  • Loading branch information
tlbueno committed Sep 2, 2024
1 parent dda9cb0 commit 044683b
Show file tree
Hide file tree
Showing 18 changed files with 755 additions and 319 deletions.
28 changes: 28 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.dockerignore
.git*
.idea/
*.iml
*/target/
*/test-cfg/
*/test-logs/
*/test-tmp/
/target/
common.yaml
operator-suite/artemis/
operator-suite/certificates/
operator-suite/container/
operator-suite/operator-suite.log
operator-suite/serialization-dump/
performance/
pom.xml.versionsBackup
settings.xml
standalone-suite/artemis/
standalone-suite/certificates/
standalone-suite/dockerfiles/artemis/*.gz
standalone-suite/dockerfiles/artemis/*.xz
standalone-suite/https_console_tune.yaml
standalone-suite/standalone-suite.log
standalone-suite/test-cfg/
test_upgrade_plan.yaml
test-results/
version_map.yaml
25 changes: 13 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
.idea/
*.iml
/target/*
*/target/*
*/target/
*/test-cfg/
*/test-logs/
*/test-tmp/*

pom.xml.versionsBackup
test_upgrade_plan.yaml
version_map.yaml
*/test-tmp/
/target/
common.yaml
settings.xml
performance/
operator-suite/artemis/
operator-suite/certificates/
operator-suite/operator-suite.log
operator-suite/serialization-dump/
performance/
pom.xml.versionsBackup
settings.xml
standalone-suite/artemis/
standalone-suite/standalone-suite.log
standalone-suite/test-cfg/
standalone-suite/certificates/
standalone-suite/dockerfiles/artemis/*.gz
standalone-suite/dockerfiles/artemis/*.xz
standalone-suite/certificates/
standalone-suite/https_console_tune.yaml
standalone-suite/standalone-suite.log
standalone-suite/test-cfg/
test_upgrade_plan.yaml
test-results/
version_map.yaml
106 changes: 0 additions & 106 deletions Containerfile

This file was deleted.

67 changes: 58 additions & 9 deletions Makefile.downstream
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ ROOT_DIR = $(shell dirname $(realpath $
# as an example, artemiscloud-crd generated by us for the downstream build may needs to be rebuild
# multiple times without version number change and our CI job may need to be executed in multiple
# times in a short period causing maven to skip the download of the new dependencies.
MVN_DEFAULT_CMD = mvn --update-snapshots --no-transfer-progress -s ${ROOT_DIR}/settings.xml
MVN_DEFAULT_CMD = echo "MAVEN_OPTS: ${MAVEN_OPTS}" ; echo "MAVEN_ARGS: ${MAVEN_ARGS}" ; mvn --no-transfer-progress --batch-mode --update-snapshots -s ${ROOT_DIR}/settings.xml ${MVN_ADDITIONAL_PARAMS}
MVN_TEST_CMD = ${MVN_DEFAULT_CMD} failsafe:integration-test
MVN_ADDITIONAL_PARAMS ?=
WGET_CMD = wget -nv -c

ARTEMIS_VERSION ?= 7.12.0
ARTEMIS_VERSION ?= 7.12.1
RELEASE_TYPE ?= candidate

OPERATOR_ROOT_DIR = ${ROOT_DIR}/operator-suite
Expand All @@ -26,6 +27,8 @@ STANDALONE_PASSWORD = admin
STANDALONE_CONTAINER_ARTEMIS_INSTANCE_DIR = /var/lib/artemis-instance
STANDALONE_CONTAINER_ARTEMIS_INSTANCE_ETC_DIR = ${STANDALONE_CONTAINER_ARTEMIS_INSTANCE_DIR}/etc

COMMIT_ID = $(shell git rev-parse HEAD 2>/dev/null || true)

ifdef TESTS
$(eval MVN_TESTS_PARAM := -Dit.test="${TESTS}")
endif
Expand All @@ -49,14 +52,14 @@ checkstyle: get_settings_xml_file
${MVN_DEFAULT_CMD} checkstyle:check

get_settings_xml_file:
${WGET_CMD} "https://gitlab.cee.redhat.com/amq-broker/amq-broker-ci/-/raw/main/resources/claire/claire-settings.xml" -O "${ROOT_DIR}/settings.xml"
${WGET_CMD} --no-check-certificate "https://gitlab.cee.redhat.com/amq-broker/amq-broker-ci/-/raw/main/resources/claire/claire-settings.xml" -O "${ROOT_DIR}/settings.xml"

get_metadata_files:
${WGET_CMD} "https://gitlab.cee.redhat.com/amq-broker/amq-broker-metadata/-/raw/main/broker_properties/amq_broker/version_map.yaml" -O "${ROOT_DIR}/version_map.yaml"
${WGET_CMD} "https://gitlab.cee.redhat.com/amq-broker/amq-broker-metadata/-/raw/main/broker_properties/amq_broker/common.yaml" -O "${ROOT_DIR}/common.yaml"
${WGET_CMD} --no-check-certificate "https://gitlab.cee.redhat.com/amq-broker/amq-broker-metadata/-/raw/main/broker_properties/amq_broker/version_map.yaml" -O "${ROOT_DIR}/version_map.yaml"
${WGET_CMD} --no-check-certificate "https://gitlab.cee.redhat.com/amq-broker/amq-broker-metadata/-/raw/main/broker_properties/amq_broker/common.yaml" -O "${ROOT_DIR}/common.yaml"

display_mvn_property_updates:
mvn --update-snapshots --no-transfer-progress versions:display-property-updates
display_mvn_property_updates: get_settings_xml_file
${MVN_DEFAULT_CMD} versions:display-property-updates

### Standalone targets
standalone_clean:
Expand All @@ -72,7 +75,7 @@ endif
standalone_prepare: get_settings_xml_file get_metadata_files standalone_prepare_urls standalone_prepare_dirs standalone_download_zip standalone_generate_artemis_default_cfg

standalone_build_java:
${MVN_DEFAULT_CMD} --projects :standalone-suite install -DskipTests
${MVN_DEFAULT_CMD} --projects :standalone-suite --also-make -DskipTests install

standalone_build: standalone_prepare standalone_build_java

Expand Down Expand Up @@ -122,14 +125,60 @@ operator_prepare: get_settings_xml_file get_metadata_files operator_prepare_urls

operator_build_java:
${MVN_DEFAULT_CMD} versions:update-property -DallowDowngrade=true -Dproperty=artemiscloud-crd.version -DnewVersion=[${OPERATOR_CR_VERSION}]
${MVN_DEFAULT_CMD} --projects :operator-suite install -DskipTests
${MVN_DEFAULT_CMD} --projects :operator-suite -DskipTests --also-make install

operator_build: operator_prepare operator_build_java

operator_get_dependencies: operator_prepare
${MVN_DEFAULT_CMD} versions:update-property -DallowDowngrade=true -Dproperty=artemiscloud-crd.version -DnewVersion=[${OPERATOR_CR_VERSION}]
${MVN_DEFAULT_CMD} --projects :claire,:operator-suite,:common dependency:go-offline dependency:resolve-plugins

operator_test_smoke:
${MVN_TEST_CMD} --projects :operator-suite -Dgroups="smoke"

operator_test:
${MVN_TEST_CMD} --projects :operator-suite ${MVN_TESTS_PARAM} ${MVN_GROUPS_PARAM}

### Common targets
common_build: get_settings_xml_file get_metadata_files common_build_java

common_build_java:
${MVN_DEFAULT_CMD} --projects common -DskipTests -Dcheckstyle.skip install


### Container image targets
container_prepare:
$(eval OPR_VERSION := amq-broker-$(shell echo "${OPERATOR_CR_VERSION}" | sed -E 's/([0-9]+\.[0-9]+\.[0-9]+\.[A-Za-z0-9]+\.[0-9]+).*/\1/'))
$(eval VERSION_MM := amq-broker-$(shell echo "${OPERATOR_CR_VERSION}" | sed -E 's/([0-9]+\.[0-9]+).*/\1/'))
$(eval VERSION_MMM := amq-broker-$(shell echo "${OPERATOR_CR_VERSION}" | sed -E 's/([0-9]+\.[0-9]+\.[0-9]+).*/\1/'))

container_build: clean operator_prepare container_prepare
echo "Preparing host for multi arch build"
sudo podman run --privileged --rm docker.io/tonistiigi/binfmt --install all
echo "Building container"
podman manifest rm quay.io/rhmessagingqe/claire:${OPR_VERSION} 2> /dev/null || true
podman build \
--file operator-suite/container/Containerfile \
--manifest quay.io/rhmessagingqe/claire:${OPR_VERSION} \
--platform linux/amd64,linux/arm64,linux/ppc64le,linux/s390x \
--jobs 42 \
--build-arg makeParams="-f Makefile.downstream" \
--build-arg commitId=${COMMIT_ID} \
.

container_push: operator_prepare container_prepare
podman push quay.io/rhmessagingqe/claire:${OPR_VERSION}
podman tag \
quay.io/rhmessagingqe/claire:${OPR_VERSION} \
quay.io/rhmessagingqe/claire:${VERSION_MMM}
podman push quay.io/rhmessagingqe/claire:${VERSION_MMM}
podman tag \
quay.io/rhmessagingqe/claire:${OPR_VERSION} \
quay.io/rhmessagingqe/claire:${VERSION_MM}
podman push quay.io/rhmessagingqe/claire:${VERSION_MM}
podman tag \
quay.io/rhmessagingqe/claire:${OPR_VERSION} \
quay.io/rhmessagingqe/claire:amq-broker-lpt
podman push quay.io/rhmessagingqe/claire:amq-broker-lpt

.PHONY: clean
15 changes: 0 additions & 15 deletions container_data/entrypoint.sh

This file was deleted.

Loading

0 comments on commit 044683b

Please sign in to comment.