diff --git a/.github/actions/build-component-multi-arch/action.yml b/.github/actions/build-component-multi-arch/action.yml deleted file mode 100644 index 06b76bfd2..000000000 --- a/.github/actions/build-component-multi-arch/action.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: 'build-component-multi-arch' -description: 'Build Akri Component Container' -inputs: - container_registry_base_url: - description: Container Registry - required: true - container_registry_username: - description: Container Registry name - required: true - container_registry_password: - description: Container Registry password - required: true - container_name: - description: Component container name - required: true - container_prefix: - description: Container prefix (i.e. 'myacr.acr.io/foo' for myacr.acr.io/foo/container:label) - required: true - makefile_component_name: - description: Component prefix used by Makefile - required: true - github_event_name: - description: Specify the github event name (push, pull_request, release, etc) - required: true -runs: - using: 'node16' - main: 'main.js' diff --git a/.github/actions/build-component-multi-arch/main.js b/.github/actions/build-component-multi-arch/main.js deleted file mode 100644 index 7c600a5b3..000000000 --- a/.github/actions/build-component-multi-arch/main.js +++ /dev/null @@ -1,62 +0,0 @@ -const exec = require('@actions/exec'); -const core = require('@actions/core'); -const child_process = require('child_process'); -const fs = require("fs"); - -async function shell_cmd(cmd) { - return await new Promise((resolve, reject) => { - child_process.exec(cmd, function(error, stdout, stderr) { - if (error) { - console.log(`... error=${error}`) - reject(error) - } - - if (stderr) { - console.log(`... stderr=${stderr.trim()}`) - } - - console.log(`... stdout=${stdout.trim()}`) - resolve(stdout.trim()); - }); - }); -} - -(async () => { - try { - console.log(`Start main.js`) - - var dev_suffix = (core.getInput('github_event_name') == "release") ? "" : "-dev"; - const versioned_label = `v${fs.readFileSync('./version.txt').toString().trim()}${dev_suffix}`; - const latest_label = `latest${dev_suffix}`; - console.log(`Use labels: versioned=${versioned_label} latest=${latest_label}`); - - console.log(`Login into Container Registry user=${core.getInput('container_registry_username')} repo=${core.getInput('container_registry_base_url')}`); - await shell_cmd(`echo "${core.getInput('container_registry_password')}" | docker login -u ${core.getInput('container_registry_username')} --password-stdin ${core.getInput('container_registry_base_url')}`); - - process.env.DOCKER_CLI_EXPERIMENTAL = `enabled` - process.env.PREFIX = `${core.getInput('container_prefix')}` - process.env.LABEL_PREFIX = `${versioned_label}` - - console.log(`echo Create multi-arch versioned manifest`) - await exec.exec(`make ${core.getInput('makefile_component_name')}-docker-multi-arch-create`) - - console.log(`echo Inspect multi-arch versioned manifest`) - await exec.exec(`docker manifest inspect ${core.getInput('container_prefix')}/${core.getInput('container_name')}:${versioned_label}`) - - console.log(`echo Push multi-arch versioned manifest`) - await exec.exec(`make ${core.getInput('makefile_component_name')}-docker-multi-arch-push`) - - process.env.LABEL_PREFIX = `${latest_label}` - - console.log(`echo Create multi-arch latest manifest`) - await exec.exec(`make ${core.getInput('makefile_component_name')}-docker-multi-arch-create`) - - console.log(`echo Inspect multi-arch latest manifest`) - await exec.exec(`docker manifest inspect ${core.getInput('container_prefix')}/${core.getInput('container_name')}:${latest_label}`) - - console.log(`echo Push multi-arch latest manifest`) - await exec.exec(`make ${core.getInput('makefile_component_name')}-docker-multi-arch-push`) - } catch (error) { - core.setFailed(error); - } -})(); \ No newline at end of file diff --git a/.github/actions/build-component-multi-arch/package.json b/.github/actions/build-component-multi-arch/package.json deleted file mode 100644 index 40b329753..000000000 --- a/.github/actions/build-component-multi-arch/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "private": true, - "name": "build-component-multi-arch", - "dependencies": { - "@actions/core": "^1.2.2", - "@actions/exec": "1.0.2", - "child_process": "^1.0.2", - "fs": "^8.1.0" - } - } \ No newline at end of file diff --git a/.github/actions/build-component-per-arch/action.yml b/.github/actions/build-component-per-arch/action.yml deleted file mode 100644 index 5738139d0..000000000 --- a/.github/actions/build-component-per-arch/action.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: 'build-component-per-arch' -description: 'Build Akri Component Container' -inputs: - container_registry_base_url: - description: Container Registry - required: true - container_registry_username: - description: Container Registry name - required: true - container_registry_password: - description: Container Registry password - required: true - container_name: - description: Component container name - required: true - container_prefix: - description: Container prefix (i.e. 'myacr.acr.io/foo' for myacr.acr.io/foo/container:label) - required: true - makefile_component_name: - description: Component prefix used by Makefile - required: true - platform: - description: Platform to build (amd64|arm64|arm32) - required: true - build_rust: - description: Specify whether rust is being built - required: true - github_event_name: - description: Specify the github event name (push, pull_request, release, etc) - required: true - github_ref: - description: Specify the github ref - required: true - github_event_action: - description: Specify the github event action (i.e. closed) - required: true - github_merged: - description: Specify whether a PR has been merged - required: true -runs: - using: 'node16' - main: 'main.js' diff --git a/.github/actions/build-component-per-arch/main.js b/.github/actions/build-component-per-arch/main.js deleted file mode 100644 index 6dda65f39..000000000 --- a/.github/actions/build-component-per-arch/main.js +++ /dev/null @@ -1,114 +0,0 @@ -const exec = require('@actions/exec'); -const core = require('@actions/core'); -const child_process = require('child_process'); -const fs = require("fs"); - -async function shell_cmd(cmd) { - return await new Promise((resolve, reject) => { - child_process.exec(cmd, function(error, stdout, stderr) { - if (error) { - console.log(`... error=${error}`) - reject(error) - } - - if (stderr) { - console.log(`... stderr=${stderr.trim()}`) - } - - console.log(`... stdout=${stdout.trim()}`) - resolve(stdout.trim()); - }); - }); -} - -(async () => { - try { - console.log(`Start main.js`) - - console.log(`Use multiarch/qemu-user-static to configure cross-plat`); - await shell_cmd('docker run --rm --privileged multiarch/qemu-user-static --reset -p yes'); - - var dev_suffix = (core.getInput('github_event_name') == "release") ? "" : "-dev"; - const versioned_label = `v${fs.readFileSync('./version.txt').toString().trim()}${dev_suffix}`; - const latest_label = `latest${dev_suffix}`; - console.log(`Use labels: versioned=${versioned_label} latest=${latest_label}`); - - var push_containers = 0; - if (core.getInput('github_event_name') == 'release') push_containers = 1; - else if (core.getInput('github_event_name') == 'push' && - core.getInput('github_ref') == 'refs/heads/main') push_containers = 1; - else if (core.getInput('github_event_name').startsWith('pull_request') && - core.getInput('github_event_action') == 'closed' && - core.getInput('github_ref') == 'refs/heads/main' && - core.getInput('github_merged') == 'true') push_containers = 1; - else console.log(`Not pushing containers ... event: ${core.getInput('github_event_name')}, ref: ${core.getInput('github_ref')}, action: ${core.getInput('github_event_action')}, merged: ${core.getInput('github_merged')}`); - console.log(`Push containers: ${push_containers}`); - - var makefile_target_suffix = ""; - switch (core.getInput('platform')) { - case "amd64": - process.env.BUILD_AMD64 = 1 - makefile_target_suffix = "amd64"; - break; - case "arm32v7": - process.env.BUILD_ARM32 = 1 - makefile_target_suffix = "arm32"; - break; - case "arm64v8": - process.env.BUILD_ARM64 = 1 - makefile_target_suffix = "arm64"; - break; - default: - core.setFailed(`Failed with unknown platform: ${core.getInput('platform')}`) - return - } - - console.log(`Makefile build target suffix: ${makefile_target_suffix}`) - - if (core.getInput('build_rust') == '1') { - console.log(`Install Rust`) - child_process.execSync(`curl https://sh.rustup.rs | sh -s -- -y --default-toolchain=1.68.1`); - const bindir = `${process.env.HOME}/.cargo/bin`; - process.env.PATH = `${process.env.PATH}:${bindir}`; - - console.log(`Check cargo version`) - await shell_cmd('cargo --version') - console.log(`Install Cross`) - await shell_cmd('make install-cross') - await shell_cmd('cross --version') - console.log(`Cross compile: akri-cross-build-${makefile_target_suffix}`) - await exec.exec(`make akri-cross-build-${makefile_target_suffix}`) - } else { - console.log(`Not building Rust: ${core.getInput('build_rust')}`) - } - - process.env.PREFIX = `${core.getInput('container_prefix')}` - - console.log(`Build the versioned container: make ${core.getInput('makefile_component_name')}-build-${makefile_target_suffix}`) - process.env.LABEL_PREFIX = `${versioned_label}` - await exec.exec(`make ${core.getInput('makefile_component_name')}-build-${makefile_target_suffix}`) - - console.log(`Build the latest container: make ${core.getInput('makefile_component_name')}-build-${makefile_target_suffix}`) - process.env.LABEL_PREFIX = `${latest_label}` - await exec.exec(`make ${core.getInput('makefile_component_name')}-build-${makefile_target_suffix}`) - - const image_name = `${core.getInput('container_prefix')}/${core.getInput('container_name')}:${versioned_label}-${core.getInput('platform')}` - - if (push_containers == "1") { - console.log(`Login into Container Registry user=${core.getInput('container_registry_username')} repo=${core.getInput('container_registry_base_url')}`); - await shell_cmd(`echo "${core.getInput('container_registry_password')}" | docker login -u ${core.getInput('container_registry_username')} --password-stdin ${core.getInput('container_registry_base_url')}`); - - console.log(`Push the versioned container: make ${core.getInput('makefile_component_name')}-docker-per-arch-${makefile_target_suffix}`) - process.env.LABEL_PREFIX = `${versioned_label}` - await exec.exec(`make ${core.getInput('makefile_component_name')}-docker-per-arch-${makefile_target_suffix}`) - - console.log(`Push the latest container: make ${core.getInput('makefile_component_name')}-docker-per-arch-${makefile_target_suffix}`) - process.env.LABEL_PREFIX = `${latest_label}` - await exec.exec(`make ${core.getInput('makefile_component_name')}-docker-per-arch-${makefile_target_suffix}`) - } else { - console.log(`Not pushing containers: ${push_containers}`) - } - } catch (error) { - core.setFailed(error); - } -})(); \ No newline at end of file diff --git a/.github/actions/build-component-per-arch/package.json b/.github/actions/build-component-per-arch/package.json deleted file mode 100644 index d3f346b8a..000000000 --- a/.github/actions/build-component-per-arch/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "private": true, - "name": "build-component-per-arch", - "dependencies": { - "@actions/core": "^1.2.2", - "@actions/exec": "1.0.2", - "child_process": "^1.0.2", - "fs": "^8.1.0" - } - } \ No newline at end of file diff --git a/.github/actions/build-intermediate/action.yml b/.github/actions/build-intermediate/action.yml deleted file mode 100644 index 3e7fde3f1..000000000 --- a/.github/actions/build-intermediate/action.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: 'build-component-per-arch' -description: 'Build Akri Component Container' -inputs: - container_registry_base_url: - description: Container Registry - required: true - container_registry_username: - description: Container Registry name - required: true - container_registry_password: - description: Container Registry password - required: true - container_name: - description: Container name - required: true - container_prefix: - description: Container prefix (i.e. 'myacr.acr.io/foo' for myacr.acr.io/foo/container:label) - required: true - makefile_component_name: - description: Component prefix used by Makefile - required: true - platform: - description: Platform to build (amd64|arm64|arm32) - required: true - github_event_name: - description: Specify the github event name (push, pull_request, release, etc) - required: true - github_ref: - description: Specify the github ref - required: true - github_event_action: - description: Specify the github event action (i.e. closed) - required: true - github_merged: - description: Specify whether a PR has been merged - required: true -runs: - using: 'node16' - main: 'main.js' diff --git a/.github/actions/build-intermediate/main.js b/.github/actions/build-intermediate/main.js deleted file mode 100644 index 1973f86ec..000000000 --- a/.github/actions/build-intermediate/main.js +++ /dev/null @@ -1,79 +0,0 @@ -const exec = require('@actions/exec'); -const core = require('@actions/core'); -const child_process = require('child_process'); -const fs = require("fs"); - -async function shell_cmd(cmd) { - return await new Promise((resolve, reject) => { - child_process.exec(cmd, function(error, stdout, stderr) { - if (error) { - console.log(`... error=${error}`) - reject(error) - } - - if (stderr) { - console.log(`... stderr=${stderr.trim()}`) - } - - console.log(`... stdout=${stdout.trim()}`) - resolve(stdout.trim()); - }); - }); -} - -(async () => { - try { - console.log(`Start main.js`) - - console.log(`Use multiarch/qemu-user-static to configure cross-plat`); - child_process.execSync('docker run --rm --privileged multiarch/qemu-user-static --reset -p yes'); - - var push_containers = 0; - if (core.getInput('github_event_name') == 'release') push_containers = 1; - else if (core.getInput('github_event_name') == 'push' && - core.getInput('github_ref') == 'refs/heads/main') push_containers = 1; - else if (core.getInput('github_event_name').startsWith('pull_request') && - core.getInput('github_event_action') == 'closed' && - core.getInput('github_ref') == 'refs/heads/main' && - core.getInput('github_merged') == 'true') push_containers = 1; - else console.log(`Not pushing containers ... event: ${core.getInput('github_event_name')}, ref: ${core.getInput('github_ref')}, action: ${core.getInput('github_event_action')}, merged: ${core.getInput('github_merged')}`); - console.log(`Push containers: ${push_containers}`); - - var makefile_target_suffix = ""; - switch (core.getInput('platform')) { - case "amd64": - process.env.BUILD_AMD64 = 1 - makefile_target_suffix = "amd64"; - break; - case "arm32v7": - process.env.BUILD_ARM32 = 1 - makefile_target_suffix = "arm32"; - break; - case "arm64v8": - process.env.BUILD_ARM64 = 1 - makefile_target_suffix = "arm64"; - break; - default: - core.setFailed(`Failed with unknown platform: ${core.getInput('platform')}`) - return - } - console.log(`Makefile build target suffix: ${makefile_target_suffix}`) - - process.env.PREFIX = `${core.getInput('container_prefix')}` - - console.log(`Build the versioned container: make ${core.getInput('makefile_component_name')}-build-${makefile_target_suffix}`) - await exec.exec(`make ${core.getInput('makefile_component_name')}-build-${makefile_target_suffix}`) - - if (push_containers == "1") { - console.log(`Login into Container Registry user=${core.getInput('container_registry_username')} repo=${core.getInput('container_registry_base_url')}`); - await shell_cmd(`echo "${core.getInput('container_registry_password')}" | docker login -u ${core.getInput('container_registry_username')} --password-stdin ${core.getInput('container_registry_base_url')}`); - - console.log(`Push the versioned container: make ${core.getInput('makefile_component_name')}-docker-per-arch-${makefile_target_suffix}`) - await exec.exec(`make ${core.getInput('makefile_component_name')}-docker-per-arch-${makefile_target_suffix}`) - } else { - console.log(`Not pushing containers: ${push_containers}`) - } - } catch (error) { - core.setFailed(error); - } -})(); \ No newline at end of file diff --git a/.github/actions/build-intermediate/package.json b/.github/actions/build-intermediate/package.json deleted file mode 100644 index 3504049ff..000000000 --- a/.github/actions/build-intermediate/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "private": true, - "name": "build-intermediate", - "dependencies": { - "@actions/core": "^1.2.2", - "@actions/exec": "1.0.2", - "child_process": "^1.0.2", - "fs": "^8.1.0" - } - } \ No newline at end of file diff --git a/.github/workflows/run-test-cases.yml b/.github/workflows/run-test-cases.yml index 2e4b23294..b798d7f25 100644 --- a/.github/workflows/run-test-cases.yml +++ b/.github/workflows/run-test-cases.yml @@ -108,7 +108,7 @@ jobs: test-cases: needs: build-containers runs-on: ubuntu-latest - timeout-minutes: 90 + timeout-minutes: 95 strategy: fail-fast: false @@ -279,8 +279,8 @@ jobs: # For push and release, we need to wait for the Helm chart and # associated containers to build. - if: github.event_name == 'push' || github.event_name == 'release' - name: sleep before running script for 2700s - run: sleep 2700 + name: sleep before running script for 80 minutes + run: sleep 4800 - name: Execute test script working-directory: ./test/e2e