From c561a2a95e1b86e7a51ae3d0f53d68efd533bc1f Mon Sep 17 00:00:00 2001 From: Armel Soro Date: Thu, 8 Jun 2023 18:10:20 +0200 Subject: [PATCH 1/5] Build nightly versions of odo and upload them to IBM Cloud Object Storage --- .github/workflows/nightly-build.yaml | 71 ++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 .github/workflows/nightly-build.yaml diff --git a/.github/workflows/nightly-build.yaml b/.github/workflows/nightly-build.yaml new file mode 100644 index 00000000000..506de5068c5 --- /dev/null +++ b/.github/workflows/nightly-build.yaml @@ -0,0 +1,71 @@ +name: Nightly builds + +on: + schedule: + - cron: "0 0 * * *" + +concurrency: ${{ github.workflow }} + +jobs: + + nightly_build: + runs-on: ubuntu-latest + + env: + IBM_CLOUD_API_KEY: ${{ secrets.IBM_CLOUD_API_KEY_NIGHTLY_BUILDS }} + IBM_CLOUD_RESOURCE_GROUP: ${{ secrets.IBM_CLOUD_RESOURCE_GROUP }} + IBM_CLOUD_REGION: eu-de + IBM_CLOUD_OBJET_STORAGE_SERVICE_INSTANCE: ${{ secrets.IBM_CLOUD_OBJET_STORAGE_SERVICE_INSTANCE }} + IBM_CLOUD_OBJECT_STORAGE_BUCKET: ${{ secrets.IBM_CLOUD_OBJECT_STORAGE_BUCKET }} + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup Go + uses: actions/setup-go@v3 + with: + go-version-file: 'go.mod' + + - name: Install IBM Cloud CLI + run: | + curl -fsSL https://clis.cloud.ibm.com/install/linux | sh + ibmcloud --version + ibmcloud config --check-version=false + ibmcloud plugin install -f cloud-object-storage + + - name: Authenticate with IBM Cloud CLI + run: | + ibmcloud login --apikey "${IBM_CLOUD_API_KEY}" -r "${IBM_CLOUD_REGION}" -g "${IBM_CLOUD_RESOURCE_GROUP}" --quiet + + - name: Set CRN + run: | + CRN=$(ibmcloud resource service-instance "${IBM_CLOUD_OBJET_STORAGE_SERVICE_INSTANCE}" --output json | jq -r '.[0].guid | values') + if [[ -z "$CRN" ]]; then + echo "Unable to determine CRN for service instance ${IBM_CLOUD_OBJET_STORAGE_SERVICE_INSTANCE}" + exit 1 + fi + ibmcloud cos config crn --crn "${CRN}" + + - name: Check if bucket exists + run: | + if ! ibmcloud cos buckets | grep "${IBM_CLOUD_OBJECT_STORAGE_BUCKET}"; then + echo "Bucket not found: ${IBM_CLOUD_OBJECT_STORAGE_BUCKET}" + exit 1 + fi + + - name: Cross-compile odo + run: make cross + + - name: Upload binaries + run: | + baseUrl="https://s3.${IBM_CLOUD_REGION}.cloud-object-storage.appdomain.cloud/${IBM_CLOUD_OBJECT_STORAGE_BUCKET}" + for f in `find ./dist/bin -type f -name 'odo*'`; do + bin=$(realpath "$f") + targetName=$(basename "$f" .exe)-$(basename $(dirname "$f")) + if [[ "${targetName}" == "odo-windows-"* ]]; then + targetName="${targetName}.exe" + fi + ibmcloud cos upload --bucket "${IBM_CLOUD_OBJECT_STORAGE_BUCKET}" --key "${targetName}" --file "${bin}" + echo "Binary $bin uploaded successfully and available at: ${baseUrl}/${targetName}" + done From 153e04b4b7b000fd689413121222a9a051e708cb Mon Sep 17 00:00:00 2001 From: Armel Soro Date: Thu, 8 Jun 2023 18:10:39 +0200 Subject: [PATCH 2/5] Document where the nightly builds can be downloaded and installed --- docs/website/docs/overview/installation.md | 201 ++++++++++++++++++++- 1 file changed, 198 insertions(+), 3 deletions(-) diff --git a/docs/website/docs/overview/installation.md b/docs/website/docs/overview/installation.md index fd2322384ee..b2a0aa519d9 100644 --- a/docs/website/docs/overview/installation.md +++ b/docs/website/docs/overview/installation.md @@ -5,6 +5,9 @@ toc_min_heading_level: 2 toc_max_heading_level: 4 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + `odo` can be used as either a [CLI tool](#cli-installation) or an [IDE plugin](#ide-installation) on [Mac](#macos), [Windows](#windows) or [Linux](#linux). Each release is *signed*, *checksummed*, *verified*, and then pushed to our [binary mirror](https://developers.redhat.com/content-gateway/rest/mirror/pub/openshift-v4/clients/odo/). @@ -15,9 +18,6 @@ For more information on the changes of each release, they can be viewed either o ### Linux -import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; - + + + +Installing `odo` on `amd64` architecture: + +1. Download the latest nightly build: +```shell +curl -L https://s3.eu-de.cloud-object-storage.appdomain.cloud/odo-nightly-builds/odo-linux-amd64 -o odo +``` + +2. Install odo: +```shell +sudo install -o root -g root -m 0755 odo /usr/local/bin/odo +``` + +3. (Optional) If you do not have root access, you can install `odo` to the local directory and add it to your `$PATH`: + +```shell +mkdir -p $HOME/bin +cp ./odo $HOME/bin/odo +export PATH=$PATH:$HOME/bin +# (Optional) Add the $HOME/bin to your shell initialization file +echo 'export PATH=$PATH:$HOME/bin' >> ~/.bashrc +``` + + + + +Installing `odo` on `arm64` architecture: + +1. Download the latest nightly build: +```shell +curl -L https://s3.eu-de.cloud-object-storage.appdomain.cloud/odo-nightly-builds/odo-linux-arm64 -o odo +``` + +2. Install odo: +```shell +sudo install -o root -g root -m 0755 odo /usr/local/bin/odo +``` + +3(Optional) If you do not have root access, you can install `odo` to the local directory and add it to your `$PATH`: + +```shell +mkdir -p $HOME/bin +cp ./odo $HOME/bin/odo +export PATH=$PATH:$HOME/bin +# (Optional) Add the $HOME/bin to your shell initialization file +echo 'export PATH=$PATH:$HOME/bin' >> ~/.bashrc +``` + + + + +Installing `odo` on `ppc64le` architecture: + +1. Download the latest nightly build: +```shell +curl -L https://s3.eu-de.cloud-object-storage.appdomain.cloud/odo-nightly-builds/odo-linux-ppc64le -o odo +``` + +2. Install odo: +```shell +sudo install -o root -g root -m 0755 odo /usr/local/bin/odo +``` + +3(Optional) If you do not have root access, you can install `odo` to the local directory and add it to your `$PATH`: + +```shell +mkdir -p $HOME/bin +cp ./odo $HOME/bin/odo +export PATH=$PATH:$HOME/bin +# (Optional) Add the $HOME/bin to your shell initialization file +echo 'export PATH=$PATH:$HOME/bin' >> ~/.bashrc +``` + + + + +Installing `odo` on `s390x` architecture: + +1. Download the latest nightly build: +```shell +curl -L https://s3.eu-de.cloud-object-storage.appdomain.cloud/odo-nightly-builds/odo-linux-s390x -o odo +``` + +2. Install odo: +```shell +sudo install -o root -g root -m 0755 odo /usr/local/bin/odo +``` + +3. (Optional) If you do not have root access, you can install `odo` to the local directory and add it to your `$PATH`: + +```shell +mkdir -p $HOME/bin +cp ./odo $HOME/bin/odo +export PATH=$PATH:$HOME/bin +# (Optional) Add the $HOME/bin to your shell initialization file +echo 'export PATH=$PATH:$HOME/bin' >> ~/.bashrc +``` + + + + +--- + +### MacOS + + + + + +Installing `odo` on `amd64` architecture: + +1. Download the latest nightly build: +```shell +curl -L https://s3.eu-de.cloud-object-storage.appdomain.cloud/odo-nightly-builds/odo-darwin-amd64 -o odo +``` + +2. Install odo: +```shell +chmod +x ./odo +sudo mv ./odo /usr/local/bin/odo +``` + +3(Optional) If you do not have root access, you can install `odo` to the local directory and add it to your `$PATH`: + +```shell +mkdir -p $HOME/bin +cp ./odo $HOME/bin/odo +export PATH=$PATH:$HOME/bin +# (Optional) Add the $HOME/bin to your shell initialization file +echo 'export PATH=$PATH:$HOME/bin' >> ~/.bashrc +``` + + + + +Installing `odo` on `arm64` architecture: + +1. Download the latest nightly build: +```shell +curl -L https://s3.eu-de.cloud-object-storage.appdomain.cloud/odo-nightly-builds/odo-darwin-arm64 -o odo +``` + +2. Install odo: +```shell +chmod +x ./odo +sudo mv ./odo /usr/local/bin/odo +``` + +3. (Optional) If you do not have root access, you can install `odo` to the local directory and add it to your `$PATH`: + +```shell +mkdir -p $HOME/bin +cp ./odo $HOME/bin/odo +export PATH=$PATH:$HOME/bin +# (Optional) Add the $HOME/bin to your shell initialization file +echo 'export PATH=$PATH:$HOME/bin' >> ~/.bashrc +``` + + + + +--- + +### Windows + +1. Open a PowerShell terminal + +2. Download the latest nightly build: +```shell +curl -L https://s3.eu-de.cloud-object-storage.appdomain.cloud/odo-nightly-builds/odo-windows-amd64.exe -o odo.exe +``` + +3. Add the binary to your `PATH` From 077397dbd60c3b14556870b14a615c701ded4d94 Mon Sep 17 00:00:00 2001 From: Armel Soro Date: Thu, 8 Jun 2023 22:46:35 +0200 Subject: [PATCH 3/5] Allow to trigger the nightly build workflow manually if needed --- .github/workflows/nightly-build.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/nightly-build.yaml b/.github/workflows/nightly-build.yaml index 506de5068c5..48a208b0241 100644 --- a/.github/workflows/nightly-build.yaml +++ b/.github/workflows/nightly-build.yaml @@ -1,6 +1,9 @@ name: Nightly builds on: + # workflow_dispatch so that it can be triggered manually if needed + workflow_dispatch: + schedule: - cron: "0 0 * * *" From 10fc82479985126e724cc2b59bbeef279b399eb0 Mon Sep 17 00:00:00 2001 From: Armel Soro Date: Fri, 9 Jun 2023 12:05:49 +0200 Subject: [PATCH 4/5] Add a '-nightly' suffix to the commit id included at build time This will help users running 'odo' know that they are running a nightly build, e.g.: ``` $ ./odo version odo v3.11.0 (077397dbd-nightly) ``` --- .github/workflows/nightly-build.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nightly-build.yaml b/.github/workflows/nightly-build.yaml index 48a208b0241..4e403d5d01b 100644 --- a/.github/workflows/nightly-build.yaml +++ b/.github/workflows/nightly-build.yaml @@ -58,7 +58,9 @@ jobs: fi - name: Cross-compile odo - run: make cross + run: | + export GITCOMMIT="$(git describe --no-match --always --abbrev=9 --dirty --broken)-nightly" + make cross - name: Upload binaries run: | From b6c7777eae56ee71e1ec8748165decf4330dcfc9 Mon Sep 17 00:00:00 2001 From: Armel Soro Date: Tue, 13 Jun 2023 14:51:46 +0200 Subject: [PATCH 5/5] Use an arbitrary cron schedule in the night to avoid peak executions at midnight Co-authored-by: Philippe Martin --- .github/workflows/nightly-build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly-build.yaml b/.github/workflows/nightly-build.yaml index 4e403d5d01b..e791a04a45b 100644 --- a/.github/workflows/nightly-build.yaml +++ b/.github/workflows/nightly-build.yaml @@ -5,7 +5,7 @@ on: workflow_dispatch: schedule: - - cron: "0 0 * * *" + - cron: "34 21 * * *" concurrency: ${{ github.workflow }}