diff --git a/.github/workflows/build-cli-base.yml b/.github/workflows/build-cli-base.yml index e384ed5..efa9469 100644 --- a/.github/workflows/build-cli-base.yml +++ b/.github/workflows/build-cli-base.yml @@ -5,6 +5,11 @@ on: tags-ignore: [ "**" ] release: types: [ published ] +env: + ARTIFACTORY_TOKEN: ${{ secrets.ARTIFACTORY_TOKEN }} + QUAYIO_USERNAME: ${{ secrets.QUAYIO_USERNAME }} + QUAYIO_PASSWORD: ${{ secrets.QUAYIO_PASSWORD }} + W3_USERNAME: ${{ secrets.W3_USERNAME }} jobs: build-amd64: @@ -27,23 +32,7 @@ jobs: - name: Build the docker image (amd64) run: | echo "GITHUB_REF=$GITHUB_REF" - echo "GITHUB_EVENT_NAME=$GITHUB_EVENT_NAME" - - # Login to quay.io - docker login --username "${{ secrets.QUAYIO_USERNAME }}" --password "${{ secrets.QUAYIO_PASSWORD }}" quay.io - - # Build the image - $GITHUB_WORKSPACE/build/bin/docker-build.sh -r quay.io/ibmmas/cli-base --target-platform amd64 -b image/cli-base - - # Squash the image layers - python3 -m pip install docker-squash - docker-squash --load-image --tag quay.io/ibmmas/cli-base:${{ env.DOCKER_TAG }}-amd64 quay.io/ibmmas/cli-base:${{ env.DOCKER_TAG }}-amd64 - - # List available images - docker images - - # Push the images - docker push quay.io/ibmmas/cli-base:${{ env.DOCKER_TAG }}-amd64 + source $GITHUB_WORKSPACE/build/bin/build.sh amd64 build-s390x: name: Build Image (s390x) @@ -63,31 +52,31 @@ jobs: source $GITHUB_WORKSPACE/build/bin/.functions.sh - name: Build the docker image (s390x) - env: - ARTIFACTORY_TOKEN: ${{ secrets.ARTIFACTORY_TOKEN }} run: | echo "GITHUB_REF=$GITHUB_REF" - echo "GITHUB_EVENT_NAME=$GITHUB_EVENT_NAME" + source $GITHUB_WORKSPACE/build/bin/build.sh s390x - # Login to quay.io - docker login --username "${{ secrets.QUAYIO_USERNAME }}" --password "${{ secrets.QUAYIO_PASSWORD }}" quay.io - - # Before we build the s390x image we need to download some pre-build dependencies from Artifactory - wget --header="Authorization:Bearer $ARTIFACTORY_TOKEN" https://na.artifactory.swg-devops.com/artifactory/wiotp-generic-local/dependencies/rclone/rclone.tar.gz -O $GITHUB_WORKSPACE/image/cli-base/install/rclone.tar.gz - python3 $GITHUB_WORKSPACE/build/bin/python-collect-prebuilt-wheels.py --req-file $GITHUB_WORKSPACE/image/cli-base/install/requirements.txt --dest $GITHUB_WORKSPACE/image/cli-base/install/ --add-dependency cryptography - - # Build the images - $GITHUB_WORKSPACE/build/bin/docker-build.sh -r quay.io/ibmmas/cli-base --target-platform s390x -b image/cli-base - - # Squash the image layers - python3 -m pip install docker-squash - docker-squash --load-image --tag quay.io/ibmmas/cli-base:${{ env.DOCKER_TAG }}-s390x quay.io/ibmmas/cli-base:${{ env.DOCKER_TAG }}-s390x + build-ppc64lc: + name: Build Image (ppc64lc) + runs-on: ubuntu-latest + if: ${{ !contains(github.event.head_commit.message, '[doc]') }} + steps: + - name: Checkout + uses: actions/checkout@v4 + # Without this option, we don't get the tag information + with: + fetch-depth: 0 - # List available images - docker images + - name: Initialise the build system + run: | + chmod u+x $GITHUB_WORKSPACE/build/bin/*.sh + $GITHUB_WORKSPACE/build/bin/initbuild.sh + source $GITHUB_WORKSPACE/build/bin/.functions.sh - # Push the images - docker push quay.io/ibmmas/cli-base:${{ env.DOCKER_TAG }}-s390x + - name: Build the docker image (ppc64lc) + run: | + echo "GITHUB_REF=$GITHUB_REF" + source $GITHUB_WORKSPACE/build/bin/build.sh ppc64le build-arm64: name: Build Image (arm64) @@ -108,24 +97,7 @@ jobs: - name: Build the docker image (arm64) run: | - echo "GITHUB_REF=$GITHUB_REF" - echo "GITHUB_EVENT_NAME=$GITHUB_EVENT_NAME" - - # Login to quay.io - docker login --username "${{ secrets.QUAYIO_USERNAME }}" --password "${{ secrets.QUAYIO_PASSWORD }}" quay.io - - # Build the image - $GITHUB_WORKSPACE/build/bin/docker-build.sh -r quay.io/ibmmas/cli-base --target-platform arm64 -b image/cli-base - - # # Squash the image layers - python3 -m pip install docker-squash - docker-squash --load-image --tag quay.io/ibmmas/cli-base:${{ env.DOCKER_TAG }}-arm64 quay.io/ibmmas/cli-base:${{ env.DOCKER_TAG }}-arm64 - - # List available images - docker images - - # Push the images - docker push quay.io/ibmmas/cli-base:${{ env.DOCKER_TAG }}-arm64 + source $GITHUB_WORKSPACE/build/bin/build.sh arm64 build-manifest: name: Build Manifest @@ -134,6 +106,7 @@ jobs: - build-amd64 - build-s390x - build-arm64 + - build-ppc64lc if: ${{ !contains(github.event.head_commit.message, '[doc]') }} steps: - name: Checkout @@ -157,7 +130,7 @@ jobs: docker login --username "${{ secrets.QUAYIO_USERNAME }}" --password "${{ secrets.QUAYIO_PASSWORD }}" quay.io # Publish the manifest - $GITHUB_WORKSPACE/build/bin/docker-manifest.sh -r quay.io/ibmmas/cli-base --target-platforms amd64,s390x,arm64 + $GITHUB_WORKSPACE/build/bin/docker-manifest.sh -r quay.io/ibmmas/cli-base --target-platforms amd64,s390x,arm64,ppc64le # Re-issue the manifest under an alias where needed # https://github.com/docker/buildx/issues/1744#issuecomment-1896645786 diff --git a/README.md b/README.md index 559e1b5..dc0b581 100644 --- a/README.md +++ b/README.md @@ -3,23 +3,25 @@ This base container image allows us to build the CLI faster by separating the bu Provides: -| content | amd64 | s390x | arm64 | -| --- | --- |------| ----| -| `python3` v3.9 | ✔️ | ✔️ | ✔️ | -| `ibmcloud` v2.30.0 | ✔️ | ✔️ | ✔️ | -| `aws` | ✔️ | ❌ | ✔️ | -| `helm` v3 | ✔️ | ✔️ | ✔️ | -| `mongosh` v2.3.3 | ✔️ | ✔️ | ✔️ | -| `mongodump` v100.10.0 | ✔️ | ✔️ | ✔️ | -| `oc` | ✔️ | ✔️ | ✔️ | -| `oc mirror` | ✔️ | ✔️ | ✔️ | -| `oc ibm-pak` v1.16.2 | ✔️ | ✔️ | ✔️ | -| `skopeo` | ✔️ | ✔️ | ✔️ | -| `nano` | ✔️ | ✔️ | ✔️ | -| `jq` | ✔️ | ✔️ | ✔️ | -| `yq` v4.44.5 | ✔️ | ✔️ | ✔️ | -| `tini` v0.19.0 | ✔️ | ✔️ | ✔️ | -| `rclone` | ✔️ | ✔️ | ✔️ | -| `rosa` | ✔️ | ❌ ️ | ✔️ | -| `boto3` | ✔️ | ✔️ | ✔️ | -| `argocd` | ✔️ | ✔️ | ✔️ | +| content | amd64 | s390x | arm64 | ppc64le | +| --- | --- |------| ----|---------------------------------------------| +| `python3` v3.9 | ✔️ | ✔️ | ✔️ | ✔️ | +| `ibmcloud` v2.30.0 | ✔️ | ✔️ | ✔️ | ❌ | +| `aws` | ✔️ | ❌ | ✔️ | ❌ | +| `helm` v3 | ✔️ | ✔️ | ✔️ | ✔️ | +| `mongosh` v2.3.3 | ✔️ | ✔️ | ✔️ | ✔️ | +| `mongodump` v100.10.0 | ✔️ | ✔️ | ✔️ | ✔️ | +| `oc` | ✔️ | ✔️ | ✔️ | ✔️ | +| `oc mirror` | ✔️ | ✔️ | ✔️ | ✔️ | +| `oc ibm-pak` v1.16.2 | ✔️ | ✔️ | ✔️ |✔️ | +| `skopeo` | ✔️ | ✔️ | ✔️ | ✔️ | +| `nano` | ✔️ | ✔️ | ✔️ | ✔️ | +| `jq` | ✔️ | ✔️ | ✔️ | ✔️ | +| `yq` v4.44.5 | ✔️ | ✔️ | ✔️ | ✔️ | +| `tini` v0.19.0 | ✔️ | ✔️ | ✔️ | ✔️ | +| `rclone` | ✔️ | ✔️ | ✔️ | ✔️ | +| `rosa` | ✔️ | ❌ ️ | ✔️ | ❌ | +| `boto3` | ✔️ | ✔️ | ✔️ | ✔️ | +| `argocd` | ✔️ | ✔️ | ✔️ | ✔️ | + +Note: IBM Cloud Plugin Container-Registry is supported by ppc64le, however IBM Cloud Plugin Container-Service is not supported. \ No newline at end of file diff --git a/build/bin/build.sh b/build/bin/build.sh new file mode 100644 index 0000000..b136785 --- /dev/null +++ b/build/bin/build.sh @@ -0,0 +1,27 @@ +#!/bin/bash +set -e + +TARGET_PLATFORM=$1 +echo "GITHUB_REF=$GITHUB_REF" +echo "GITHUB_EVENT_NAME=$GITHUB_EVENT_NAME" + +# Login to quay.io +docker login --username $QUAYIO_USERNAME --password $QUAYIO_PASSWORD quay.io +if [[ "$TARGET_PLATFORM" == "s390x" || "$TARGET_PLATFORM" == "ppc64le" ]]; then + # Before we build the s390x image we need to download some pre-build dependencies from Artifactory + echo "in ... $TARGET_PLATFORM" + wget --header="Authorization:Bearer $ARTIFACTORY_TOKEN" https://na.artifactory.swg-devops.com/artifactory/wiotp-generic-local/dependencies/rclone/$TARGET_PLATFORM/rclone.tar.gz -O $GITHUB_WORKSPACE/image/cli-base/install/rclone.tar.gz + python3 $GITHUB_WORKSPACE/build/bin/python-collect-prebuilt-wheels.py --req-file $GITHUB_WORKSPACE/image/cli-base/install/requirements.txt --dest $GITHUB_WORKSPACE/image/cli-base/install/ --add-dependency cryptography --target-platform $TARGET_PLATFORM +fi +# Build the image +$GITHUB_WORKSPACE/build/bin/docker-build.sh -r quay.io/ibmmas/cli-base --target-platform $TARGET_PLATFORM -b image/cli-base + +# Squash the image layers +python3 -m pip install docker-squash +docker-squash --load-image --tag quay.io/ibmmas/cli-base:$DOCKER_TAG-$TARGET_PLATFORM quay.io/ibmmas/cli-base:$DOCKER_TAG-$TARGET_PLATFORM + +# List available images +docker images + +# Push the images +docker push quay.io/ibmmas/cli-base:$DOCKER_TAG-$TARGET_PLATFORM diff --git a/build/bin/python-collect-prebuilt-wheels.py b/build/bin/python-collect-prebuilt-wheels.py index ce20399..ba1c788 100644 --- a/build/bin/python-collect-prebuilt-wheels.py +++ b/build/bin/python-collect-prebuilt-wheels.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 +# # ----------------------------------------------------------- # Licensed Materials - Property of IBM # 5737-M66, 5900-AAA @@ -23,33 +25,39 @@ help="Target location to save the downloaded wheels of the requirements.txt file", ) parser.add_argument( - "--arch", type=str, required=False, help="Architecture of the target platform" + "--target-platform", type=str, required=False, help="Architecture of the target platform" ) parser.add_argument( - "--add-dependency", type=str, required=True, help="Additional dependencies that are image specific. Use ',' for multiple dependencies" + "--python-version", type=str, required=False, help="Specifies if a python version other than one installed on the system should be used to generate the package dependency report" ) -args = parser.parse_args() -requirementPath, destination, arch, add_dependency = args.req_file, args.dest, args.arch, args.add_dependency +# We are keeping --add-dependency and --no-default-crypto for now so that nothing breaks while we do the transition across all the repos which use this script +# But we won't be using these parameter going forward +# TODO: REMOVE THESE ARGUMENTS AFTER THE TRANSITION IS COMPLETE. +parser.add_argument( + "--add-dependency", type=str, required=False, help="Additional dependencies that are image specific. Use ',' for multiple dependencies" +) -ARTIFACTORY_URL = "https://na.artifactory.swg-devops.com/artifactory/wiotp-generic-local/dependencies/wheels/s390x" -W3_USERNAME, ARTIFACTORY_TOKEN = "y9bbfm866@nomail.relay.ibm.com", os.environ["ARTIFACTORY_TOKEN"] +parser.add_argument( + "--no-default-crypto", action='store_true', help="If this paf is set, cryptogrpahy will not be added to the default list of requirements" +) -# prebuiltpackages: List of packages that are required to download from artifactory. Contains only the package name (Can specify default packages, if required). -prebuiltpackages = [] +args = parser.parse_args() -#requirements_dict: Dictionary of packages in requirements.txt file given as argument in the format {package_name: version}. -# artifactory_wheels: List of all the packages that are already uploaded to artifactory. -requirements_dict, artifactory_wheels = {}, [] +requirementPath, destination, target_platform, python_version = args.req_file, args.dest, args.target_platform, args.python_version + +if target_platform != None: + ARTIFACTORY_URL = f"https://na.artifactory.swg-devops.com/artifactory/wiotp-generic-local/dependencies/wheels/{target_platform}" +else: + ARTIFACTORY_URL = f"https://na.artifactory.swg-devops.com/artifactory/wiotp-generic-local/dependencies/wheels/s390x" -# The additional dependencies are added to prebuiltpackages list -if add_dependency != None: - new_dependency = add_dependency.split(",") - for pkg in new_dependency: - prebuiltpackages.append(pkg) +W3_USERNAME, ARTIFACTORY_TOKEN = os.environ["W3_USERNAME"], os.environ["ARTIFACTORY_TOKEN"] -# Initialize the dictionary with None for all prebuilt packages -prebuiltpackages = {pkg_name: None for pkg_name in prebuiltpackages} +# required_packages: Dictionary that contains packages and their version that we will fetch from requirements_report.json. +required_packages = {} + +# artifactory_wheels: List of all the packages that are already uploaded to artifactory. +artifactory_wheels = [] # ************************************************************************************************************# @@ -98,70 +106,38 @@ def handle_data(self, data): if self.recording: self.data.append(data) - -def parserequirementsFile(requirementPath: str) -> dict: - """ - This function parses the requirements file and returns a dictionary of requirements with key as package name and value as its corresponding version. - Parameters: - requirementPath (str): The path to the requirements file. - Returns: - A dictionary containing the requirements and their versions. - """ - requirements_dict = {} - - with open(requirementPath, "r") as f: - requirements = f.readlines() - requirements = [requirement.strip() for requirement in requirements] - requirements = [ - requirement - for requirement in requirements - if not re.match(r"^\s*(#.*)?$", requirement) - ] - - for requirement in requirements: - delimiters = ["==", "<", ">", "<=", ">="] - for delimiter in delimiters: - if delimiter in requirement: - key, value = requirement.split(delimiter, 1) - requirements_dict[key] = value - break - return requirements_dict - def downloadWheelFromArtifactory(wheel_name: str, artifactory_wheels: list) -> None: """ Download wheel from Artifactory based on the provided wheel name. + Parameters: wheel_name (str): The name of the wheel to download. artifactory_wheels (list): A list of wheel names in Artifactory. + Returns: None """ regex = re.compile(wheel_name) - bool_artifact_found = False for artifactory_wheel in artifactory_wheels: if regex.search(artifactory_wheel): - print(f"{artifactory_wheel} found in Artifactory. Downloading...") + print(f"Downloading {artifactory_wheel} from artifactory...") command = f'wget --header="Authorization:Bearer {ARTIFACTORY_TOKEN}" "{ARTIFACTORY_URL}/{artifactory_wheel}" -P {destination}' os.system(command) - print(f"Finished downloading {wheel_name} from Artifactory.") - bool_artifact_found = True - break - if bool_artifact_found == False: - print(f"{wheel_name} does not exist in Artifactory.\nPlease make sure all the pre build pacakges are available in artifactory before running this script.\nExiting...") - print("Please upload the necesessary packages that are missing in the artifatory using the repo https://github.ibm.com/maximoappsuite/python-Zwheel.") - exit(1) + print(f"Finished downloading {artifactory_wheel} from Artifactory.\n") # ************************************************************************************************************# # SCRIPT STARTS HERE # ************************************************************************************************************# -# Create a list of requirements to fetch the versions for packages mentioned in preBuiltPackages -command2="python3 -m pip install --upgrade pip" -os.system(command2) +# Generate a requirements_report.json file for the given requirements.txt file +extra_index_url = f"--extra-index-url https://{W3_USERNAME}:{ARTIFACTORY_TOKEN}@na.artifactory.swg-devops.com/artifactory/api/pypi/wiotp-pypi-local/simple" +base_command = f"python3 -m pip install --ignore-installed --dry-run -r {requirementPath} --report requirements_report.json {extra_index_url}" +if python_version == None: + command = base_command +else: + command = f"{base_command} --python-version {python_version } --only-binary=:all:" -extra_index_url = "na.artifactory.swg-devops.com/artifactory/api/pypi/wiotp-pypi-local/simple" -command = f"python3 -m pip install --ignore-installed --dry-run -r {requirementPath} --report requirements_report.json --extra-index-url https://{W3_USERNAME}:{ARTIFACTORY_TOKEN}@{extra_index_url}" print(command) os.system(command) @@ -170,24 +146,20 @@ def downloadWheelFromArtifactory(wheel_name: str, artifactory_wheels: list) -> N f = open("requirements_report.json") requirements_report = json.load(f) - for installed_package in requirements_report.get("install", []): - metadata = installed_package.get("metadata", {}) + for required_package in requirements_report.get("install", []): + metadata = required_package.get("metadata", {}) package_name = metadata.get("name") package_version = metadata.get("version") - if package_name in prebuiltpackages: - prebuiltpackages[package_name] = package_version + required_packages[package_name] = package_version else: print(f"Failed to generate the requirements_report.json file.\nError in command: python3 -m pip install --ignore-installed --dry-run -r {requirementPath} --report requirements_report.json") exit(1) -# Parse the requirements.txt file passed as argument to the script (need to be sent while running the script as argument). -requirements_dict = parserequirementsFile(requirementPath) - -# Fetch the html content with list of all wheels present in the artifactory location. +# Fetch the html content of all the wheel packages available in the artifactory location command = f'wget -q --header="Authorization:Bearer {ARTIFACTORY_TOKEN}" "{ARTIFACTORY_URL}" -O artifactory_list.txt' os.system(command) -# If we are able to fetch the HTML contents, parse its contents to generate the list of all wheels available in artifactory. +# If we are able to fetch the HTML contents, parse its contents to generate the list of all wheels available in artifactory if os.path.isfile("artifactory_list.txt"): f = open("artifactory_list.txt", "r") parser = MyHTMLParser() @@ -197,27 +169,11 @@ def downloadWheelFromArtifactory(wheel_name: str, artifactory_wheels: list) -> N print(f"Failed to retrieve directory listing.") exit(1) -for pb_package_name in prebuiltpackages: - pb_package_v = prebuiltpackages[pb_package_name] - - if pb_package_name in requirements_dict: - # If the package is mentioned in requirements.txt, fetch the version from dictionary. - version = requirements_dict[pb_package_name] - print( - f"{pb_package_name}-{version} from prebuiltpackages exists in {requirementPath}" - ) - - wheel_name = f"{pb_package_name}-{version}" - downloadWheelFromArtifactory(wheel_name, artifactory_wheels) - - else: - if pb_package_v == 'None': - print(f"The package {pb_package_name} has no version specified in {requirementPath}. Please add the version for {pb_package_name} in {requirementPath}") - print("Exiting...") - exit(1) - - wheel_name = f"{pb_package_name}-{pb_package_v}" - print( - f"{wheel_name} from prebuiltpackages does not exist in {requirementPath}. Downloading {wheel_name}" - ) - downloadWheelFromArtifactory(wheel_name, artifactory_wheels) \ No newline at end of file +print(f"Looking for all the available prebuiltwheel packages in {ARTIFACTORY_URL}") +for pb_package_name in required_packages: + pb_package_v = required_packages[pb_package_name] + + if "-" in pb_package_name: + pb_package_name = pb_package_name.replace("-", "_") + wheel_name = f"{pb_package_name}-{pb_package_v}" + downloadWheelFromArtifactory(wheel_name, artifactory_wheels) \ No newline at end of file diff --git a/image/cli-base/install/install-aws.sh b/image/cli-base/install/install-aws.sh index e4a60e8..6f456ae 100644 --- a/image/cli-base/install/install-aws.sh +++ b/image/cli-base/install/install-aws.sh @@ -33,6 +33,10 @@ if [[ "$TARGET_PLATFORM" == "s390x" ]]; then echo "aws cli not supported in s390x" exit 0 fi +if [[ "$TARGET_PLATFORM" == "ppc64le" ]]; then + echo "aws cli not supported in ppc64le" + exit 0 +fi curl "https://awscli.amazonaws.com/awscli-exe-linux-${TARGET_PLATFORM}.zip" -o "awscliv2.zip" unzip -q awscliv2.zip diff --git a/image/cli-base/install/install-ibmcloud.sh b/image/cli-base/install/install-ibmcloud.sh index ef8eea2..a488bb2 100644 --- a/image/cli-base/install/install-ibmcloud.sh +++ b/image/cli-base/install/install-ibmcloud.sh @@ -25,12 +25,17 @@ fi CLI_VERSION=2.30.0 wget -q https://download.clis.cloud.ibm.com/ibm-cloud-cli/${CLI_VERSION}/IBM_Cloud_CLI_${CLI_VERSION}_${TARGET_PLATFORM}.tar.gz + tar -xzf IBM_Cloud_CLI_${CLI_VERSION}_${TARGET_PLATFORM}.tar.gz mv Bluemix_CLI/bin/ibmcloud /usr/local/bin/ rm -rf Bluemix_CLI IBM_Cloud_CLI_${CLI_VERSION}_${TARGET_PLATFORM}.tar.gz ibmcloud plugin repo-plugins -r 'IBM Cloud' -ibmcloud plugin install container-service ibmcloud plugin install container-registry +#Plugin not supported in ppc64le (Could not find compatible binary to install for plug-in container-service[kubernetes-service/ks] +if [[ "$TARGET_PLATFORM" != "ppc64le" ]] + then + ibmcloud plugin install container-service +fi # We don't want remove the plugins (in .bluemix/plugins) only the configuration file generated by the above actions rm /opt/app-root/src/.bluemix/config.json diff --git a/image/cli-base/install/install-mongo-tools.sh b/image/cli-base/install/install-mongo-tools.sh index 534eece..89ad999 100644 --- a/image/cli-base/install/install-mongo-tools.sh +++ b/image/cli-base/install/install-mongo-tools.sh @@ -33,9 +33,9 @@ elif [[ "$TARGET_PLATFORM" == "arm64" ]]; then rpm -i mongodb-mongosh-shared-openssl3-2.3.3.aarch64.rpm rm mongodb-mongosh-shared-openssl3-2.3.3.aarch64.rpm else - curl "https://downloads.mongodb.com/compass/mongodb-mongosh-2.3.3.s390x.rpm" -o mongodb-mongosh-2.3.3.s390x.rpm - rpm -i mongodb-mongosh-2.3.3.s390x.rpm - rm mongodb-mongosh-2.3.3.s390x.rpm + curl "https://downloads.mongodb.com/compass/mongodb-mongosh-2.3.3.$TARGET_PLATFORM.rpm" -o mongodb-mongosh-2.3.3.$TARGET_PLATFORM.rpm + rpm -i mongodb-mongosh-2.3.3.$TARGET_PLATFORM.rpm + rm mongodb-mongosh-2.3.3.$TARGET_PLATFORM.rpm fi echo "mongosh version:" mongosh --version @@ -45,8 +45,11 @@ if [[ "$TARGET_PLATFORM" == "amd64" ]]; then curl "https://fastdl.mongodb.org/tools/db/mongodb-database-tools-rhel93-x86_64-100.10.0.tgz" -o mongodb-database-tools-rhel90-x86_64-100.10.0.tgz elif [[ "$TARGET_PLATFORM" == "arm64" ]]; then curl "https://fastdl.mongodb.org/tools/db/mongodb-database-tools-rhel93-aarch64-100.10.0.tgz" -o mongodb-database-tools-rhel90-aarch64-100.10.0.tgz +elif [[ "$TARGET_PLATFORM" == "ppc64le" ]]; then + curl "https://fastdl.mongodb.org/tools/db/mongodb-database-tools-rhel81-ppc64le-100.11.0.tgz" -o mongodb-database-tools-rhel81-$TARGET_PLATFORM-100.10.0.tgz else - curl "https://fastdl.mongodb.org/tools/db/mongodb-database-tools-rhel83-s390x-100.10.0.tgz" -o mongodb-database-tools-rhel83-s390x-100.10.0.tgz + curl "https://fastdl.mongodb.org/tools/db/mongodb-database-tools-rhel83-s390x-100.10.0.tgz" -o mongodb-database-tools-rhel83-$TARGET_PLATFORM-100.10.0.tgz + fi tar xvfz mongodb-database-tools-rhel*.tgz mv mongodb-database-tools-rhel*/bin/* /usr/local/bin/ diff --git a/image/cli-base/install/install-oc.sh b/image/cli-base/install/install-oc.sh index 05e9c63..3a76ff9 100644 --- a/image/cli-base/install/install-oc.sh +++ b/image/cli-base/install/install-oc.sh @@ -40,8 +40,4 @@ tar -zxf oc-mirror.tar.gz mv oc-mirror /usr/local/bin/ chmod +x /usr/local/bin/oc-mirror rm -f oc-mirror.tar.gz - -echo "oc-mirror version:" -oc-mirror version --output json - rm -f /opt/app-root/src/.oc-mirror.log \ No newline at end of file diff --git a/image/cli-base/install/install-rclone.sh b/image/cli-base/install/install-rclone.sh index d83b4bb..a48a81d 100644 --- a/image/cli-base/install/install-rclone.sh +++ b/image/cli-base/install/install-rclone.sh @@ -24,7 +24,7 @@ if [[ "$TARGET_PLATFORM" == "amd64" || "$TARGET_PLATFORM" == "arm64" ]]; then cp ./rclone-*-linux-${TARGET_PLATFORM}/rclone /usr/local/bin/ rm -rf rclone-* else - echo "s390x rclone" + echo "rclone ${TARGET_PLATFORM}" cd /tmp/install tar -xvzf rclone.tar.gz cp rclone /usr/local/bin/ diff --git a/image/cli-base/install/install-yq.sh b/image/cli-base/install/install-yq.sh index ce665f8..edee714 100644 --- a/image/cli-base/install/install-yq.sh +++ b/image/cli-base/install/install-yq.sh @@ -22,7 +22,6 @@ if [[ "$TARGET_PLATFORM" == "" ]] then TARGET_PLATFORM=amd64 fi curl -L "https://github.com/mikefarah/yq/releases/download/v4.44.5/yq_linux_${TARGET_PLATFORM}" > /usr/bin/yq -# yq_linux_s390x chmod 755 /usr/bin/yq echo "yq version:"