From 4e76c0c3d80a6a301705a6259cd80e2ca2b79e0d Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Sat, 24 Feb 2024 22:08:18 +0100 Subject: [PATCH 01/12] feat: add Wally --- docs/custom-registries.md | 14 ++++++ renovate.json | 6 ++- src/cli/install-tool/index.ts | 2 + src/cli/tools/index.ts | 1 + src/cli/tools/wally.ts | 81 +++++++++++++++++++++++++++++++++++ test/Dockerfile.jammy | 3 ++ test/latest/Dockerfile | 31 +++++++++----- 7 files changed, 126 insertions(+), 12 deletions(-) create mode 100644 src/cli/tools/wally.ts diff --git a/docs/custom-registries.md b/docs/custom-registries.md index 2df0b97ec..b612d0903 100644 --- a/docs/custom-registries.md +++ b/docs/custom-registries.md @@ -561,3 +561,17 @@ Samples: ```txt https://github.com/vmware-tanzu/carvel-vendir/releases/download/v0.22.0/vendir-linux-amd64 ``` + +## `wally` + +Wally releases are downloaded from: + +- `https://github.com/UpliftGames/wally/releases` + +Samples: + +```txt +https://github.com/UpliftGames/wally/releases/download/v0.3.2/wally-v0.3.2-linux.zip +https://github.com/UpliftGames/wally/releases/download/v0.3.1/wally-0.3.1-linux.zip +https://github.com/UpliftGames/wally/releases/download/v0.3.0/wally-0.3.0-linux.zip +``` diff --git a/renovate.json b/renovate.json index 750c50540..e85130496 100644 --- a/renovate.json +++ b/renovate.json @@ -71,7 +71,8 @@ "renovate", "rust", "swift", - "vendir" + "vendir", + "wally" ], "separateMinorPatch": false }, @@ -98,7 +99,8 @@ "renovate", "rust", "swift", - "vendir" + "vendir", + "wally" ], "matchUpdateTypes": ["minor", "patch"], "automerge": true diff --git a/src/cli/install-tool/index.ts b/src/cli/install-tool/index.ts index dc5937b51..5cae0bbe2 100644 --- a/src/cli/install-tool/index.ts +++ b/src/cli/install-tool/index.ts @@ -21,6 +21,7 @@ import { import { InstallNpmBaseService } from '../tools/node/utils'; import { InstallCocoapodsService } from '../tools/ruby/gem'; import { InstallRubyBaseService } from '../tools/ruby/utils'; +import { InstallWallyService } from '../tools/wally'; import { logger } from '../utils'; import { InstallLegacyToolService } from './install-legacy-tool.service'; import { INSTALL_TOOL_TOKEN, InstallToolService } from './install-tool.service'; @@ -51,6 +52,7 @@ function prepareInstallContainer(): Container { container.bind(INSTALL_TOOL_TOKEN).to(InstallMavenService); container.bind(INSTALL_TOOL_TOKEN).to(InstallNodeService); container.bind(INSTALL_TOOL_TOKEN).to(InstallRenovateService); + container.bind(INSTALL_TOOL_TOKEN).to(InstallWallyService); container.bind(INSTALL_TOOL_TOKEN).to(InstallYarnSlimService); logger.trace('preparing install container done'); diff --git a/src/cli/tools/index.ts b/src/cli/tools/index.ts index 67284afde..6bd94e869 100644 --- a/src/cli/tools/index.ts +++ b/src/cli/tools/index.ts @@ -15,6 +15,7 @@ export const NoPrepareTools = [ 'npm', 'pnpm', 'renovate', + 'wally', 'yarn', 'yarn-slim', ]; diff --git a/src/cli/tools/wally.ts b/src/cli/tools/wally.ts new file mode 100644 index 000000000..f4491c0a4 --- /dev/null +++ b/src/cli/tools/wally.ts @@ -0,0 +1,81 @@ +import fs from 'node:fs/promises'; +import { join } from 'node:path'; +import { execa } from 'execa'; +import { inject, injectable } from 'inversify'; +import semver from 'semver'; +import { InstallToolBaseService } from '../install-tool/install-tool-base.service'; +import { + CompressionService, + EnvService, + HttpService, + PathService, +} from '../services'; +import { getDistro } from '../utils'; + +@injectable() +export class InstallWallyService extends InstallToolBaseService { + readonly name = 'wally'; + + constructor( + @inject(EnvService) envSvc: EnvService, + @inject(PathService) pathSvc: PathService, + @inject(HttpService) private http: HttpService, + @inject(CompressionService) private compress: CompressionService, + ) { + super(pathSvc, envSvc); + } + + override async install(version: string): Promise { + const distro = await getDistro(); + + // wally requires libssl3 which is not easily installable on focal + if (distro.versionCode === 'focal') { + throw new Error(`Unsupported distro: ${distro.versionCode}`); + } + + const baseUrl = `https://github.com/UpliftGames/wally/releases/download/v${version}/`; + let filename = `wally-v${version}-linux.zip`; + + const ver = semver.parse(version); + if (!ver) { + throw new Error(`Invalid version: ${version}`); + } + // asset names of v0.3.1 and lower are not prefixed with v + if ( + ver.major === 0 && + ver.minor <= 3 && + (ver.minor < 3 || ver.patch <= 1) + ) { + filename = `wally-${version}-linux.zip`; + } + + const file = await this.http.download({ + url: `${baseUrl}${filename}`, + }); + + // TODO: create recursive + if (!(await this.pathSvc.findToolPath(this.name))) { + await this.pathSvc.createToolPath(this.name); + } + + const path = join( + await this.pathSvc.createVersionedToolPath(this.name, version), + 'bin', + ); + await fs.mkdir(path); + await this.compress.extract({ + file, + cwd: path, + }); + } + + override async link(version: string): Promise { + const src = join(this.pathSvc.versionedToolPath(this.name, version), 'bin'); + + await this.shellwrapper({ srcDir: src }); + } + + override async test(_version: string): Promise { + await execa(this.name, ['--version'], { stdio: ['inherit', 'inherit', 1] }); + } +} diff --git a/test/Dockerfile.jammy b/test/Dockerfile.jammy index 1d39be941..037f72438 100644 --- a/test/Dockerfile.jammy +++ b/test/Dockerfile.jammy @@ -92,6 +92,9 @@ RUN install-tool jb v0.5.1 # renovate: datasource=github-releases packageName=vmware-tanzu/carvel-vendir RUN install-tool vendir v0.40.0 +# renovate: datasource=github-releases packageName=UpliftGames/wally +RUN install-tool wally v0.3.2 + #-------------------------------------- # Image: test-erlang #-------------------------------------- diff --git a/test/latest/Dockerfile b/test/latest/Dockerfile index 7dc4939ab..4b6994702 100644 --- a/test/latest/Dockerfile +++ b/test/latest/Dockerfile @@ -190,7 +190,7 @@ RUN prepare-tool all RUN set -ex; [ -d /usr/local/erlang ] && echo "works" || exit 1; #-------------------------------------- -# test: bazelisk, bun, vendir, helmfile, kustomize +# test: bazelisk, bun, gleam, helmfile, kustomize, vendir, wally #-------------------------------------- FROM base as teste @@ -203,45 +203,56 @@ RUN install-tool bun 1.0.28 # renovate: datasource=github-releases packageName=gleam-lang/gleam RUN install-tool gleam 0.34.1 -# renovate: datasource=github-releases packageName=vmware-tanzu/carvel-vendir -ARG VENDIR_VERSION=0.32.2 - # renovate: datasource=github-releases packageName=helmfile/helmfile ARG HELMFILE_VERSION=0.150.0 # renovate: datasource=github-releases packageName=kubernetes-sigs/kustomize ARG KUSTOMIZE_VERSION=5.0.0 -RUN install-tool vendir "v${VENDIR_VERSION}" +# renovate: datasource=github-releases packageName=vmware-tanzu/carvel-vendir +ARG VENDIR_VERSION=0.32.2 + +# renovate: datasource=github-releases packageName=UpliftGames/wally +ARG WALLY_VERSION=0.3.2 RUN install-tool helmfile "v${HELMFILE_VERSION}" RUN install-tool kustomize "${KUSTOMIZE_VERSION}" -RUN set -ex; vendir --version +RUN install-tool vendir "v${VENDIR_VERSION}" + +RUN install-tool wally "v${WALLY_VERSION}" RUN set -ex; helmfile version RUN set -ex; kustomize version -SHELL [ "/bin/sh", "-c" ] +RUN set -ex; vendir --version -RUN vendir --version | grep "${VENDIR_VERSION}" +RUN set -ex; wally --version + +SHELL [ "/bin/sh", "-c" ] RUN helmfile version | grep "${HELMFILE_VERSION}" RUN kustomize version | grep "${KUSTOMIZE_VERSION}" +RUN vendir --version | grep "${VENDIR_VERSION}" + +RUN wally --version | grep "${WALLY_VERSION}" + USER 1000 RUN bazel --version -RUN vendir --version | grep "${VENDIR_VERSION}" - RUN helmfile version | grep "${HELMFILE_VERSION}" RUN kustomize version | grep "${KUSTOMIZE_VERSION}" +RUN vendir --version | grep "${VENDIR_VERSION}" + +RUN wally --version | grep "${WALLY_VERSION}" + #-------------------------------------- # final #-------------------------------------- From 5e513a471beb9fd21d51ac5330d2d54c149b637f Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Sat, 7 Dec 2024 23:04:33 +0100 Subject: [PATCH 02/12] revert: reorderings --- test/latest/Dockerfile | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/test/latest/Dockerfile b/test/latest/Dockerfile index 4b6994702..0ba3a8cc6 100644 --- a/test/latest/Dockerfile +++ b/test/latest/Dockerfile @@ -190,7 +190,7 @@ RUN prepare-tool all RUN set -ex; [ -d /usr/local/erlang ] && echo "works" || exit 1; #-------------------------------------- -# test: bazelisk, bun, gleam, helmfile, kustomize, vendir, wally +# test: bazelisk, bun, vendir, helmfile, kustomize, wally #-------------------------------------- FROM base as teste @@ -203,54 +203,54 @@ RUN install-tool bun 1.0.28 # renovate: datasource=github-releases packageName=gleam-lang/gleam RUN install-tool gleam 0.34.1 +# renovate: datasource=github-releases packageName=vmware-tanzu/carvel-vendir +ARG VENDIR_VERSION=0.32.2 + # renovate: datasource=github-releases packageName=helmfile/helmfile ARG HELMFILE_VERSION=0.150.0 # renovate: datasource=github-releases packageName=kubernetes-sigs/kustomize ARG KUSTOMIZE_VERSION=5.0.0 -# renovate: datasource=github-releases packageName=vmware-tanzu/carvel-vendir -ARG VENDIR_VERSION=0.32.2 - # renovate: datasource=github-releases packageName=UpliftGames/wally ARG WALLY_VERSION=0.3.2 +RUN install-tool vendir "v${VENDIR_VERSION}" + RUN install-tool helmfile "v${HELMFILE_VERSION}" RUN install-tool kustomize "${KUSTOMIZE_VERSION}" -RUN install-tool vendir "v${VENDIR_VERSION}" - RUN install-tool wally "v${WALLY_VERSION}" +RUN set -ex; vendir --version + RUN set -ex; helmfile version RUN set -ex; kustomize version -RUN set -ex; vendir --version - RUN set -ex; wally --version SHELL [ "/bin/sh", "-c" ] +RUN vendir --version | grep "${VENDIR_VERSION}" + RUN helmfile version | grep "${HELMFILE_VERSION}" RUN kustomize version | grep "${KUSTOMIZE_VERSION}" -RUN vendir --version | grep "${VENDIR_VERSION}" - RUN wally --version | grep "${WALLY_VERSION}" USER 1000 RUN bazel --version +RUN vendir --version | grep "${VENDIR_VERSION}" + RUN helmfile version | grep "${HELMFILE_VERSION}" RUN kustomize version | grep "${KUSTOMIZE_VERSION}" -RUN vendir --version | grep "${VENDIR_VERSION}" - RUN wally --version | grep "${WALLY_VERSION}" #-------------------------------------- From 6ec878ef388066ed918d0045da9dc9d0492de7b8 Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Sat, 7 Dec 2024 23:55:49 +0100 Subject: [PATCH 03/12] fix(WallyInstallService): correct names --- src/cli/tools/wally.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/cli/tools/wally.ts b/src/cli/tools/wally.ts index f4491c0a4..206dc5e80 100644 --- a/src/cli/tools/wally.ts +++ b/src/cli/tools/wally.ts @@ -2,18 +2,17 @@ import fs from 'node:fs/promises'; import { join } from 'node:path'; import { execa } from 'execa'; import { inject, injectable } from 'inversify'; -import semver from 'semver'; -import { InstallToolBaseService } from '../install-tool/install-tool-base.service'; +import { BaseInstallService } from '../install-tool/base-install.service'; import { CompressionService, EnvService, HttpService, PathService, } from '../services'; -import { getDistro } from '../utils'; +import { getDistro, parse } from '../utils'; @injectable() -export class InstallWallyService extends InstallToolBaseService { +export class WallyInstallService extends BaseInstallService { readonly name = 'wally'; constructor( @@ -36,7 +35,7 @@ export class InstallWallyService extends InstallToolBaseService { const baseUrl = `https://github.com/UpliftGames/wally/releases/download/v${version}/`; let filename = `wally-v${version}-linux.zip`; - const ver = semver.parse(version); + const ver = parse(version); if (!ver) { throw new Error(`Invalid version: ${version}`); } From e367d344dc1e2bda54210f5fb559de627320823d Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Sun, 8 Dec 2024 00:07:42 +0100 Subject: [PATCH 04/12] refactor: update to latest project conventions --- src/cli/tools/wally.ts | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/src/cli/tools/wally.ts b/src/cli/tools/wally.ts index 206dc5e80..f188fd90a 100644 --- a/src/cli/tools/wally.ts +++ b/src/cli/tools/wally.ts @@ -1,5 +1,5 @@ import fs from 'node:fs/promises'; -import { join } from 'node:path'; +import path from 'node:path'; import { execa } from 'execa'; import { inject, injectable } from 'inversify'; import { BaseInstallService } from '../install-tool/base-install.service'; @@ -26,7 +26,6 @@ export class WallyInstallService extends BaseInstallService { override async install(version: string): Promise { const distro = await getDistro(); - // wally requires libssl3 which is not easily installable on focal if (distro.versionCode === 'focal') { throw new Error(`Unsupported distro: ${distro.versionCode}`); @@ -36,9 +35,6 @@ export class WallyInstallService extends BaseInstallService { let filename = `wally-v${version}-linux.zip`; const ver = parse(version); - if (!ver) { - throw new Error(`Invalid version: ${version}`); - } // asset names of v0.3.1 and lower are not prefixed with v if ( ver.major === 0 && @@ -51,30 +47,26 @@ export class WallyInstallService extends BaseInstallService { const file = await this.http.download({ url: `${baseUrl}${filename}`, }); - - // TODO: create recursive - if (!(await this.pathSvc.findToolPath(this.name))) { - await this.pathSvc.createToolPath(this.name); - } - - const path = join( + await this.pathSvc.ensureToolPath(this.name); + const cwd = path.join( await this.pathSvc.createVersionedToolPath(this.name, version), 'bin', ); - await fs.mkdir(path); - await this.compress.extract({ - file, - cwd: path, - }); + await fs.mkdir(cwd); + await this.compress.extract({ file, cwd }); } override async link(version: string): Promise { - const src = join(this.pathSvc.versionedToolPath(this.name, version), 'bin'); - + const src = path.join( + this.pathSvc.versionedToolPath(this.name, version), + 'bin', + ); await this.shellwrapper({ srcDir: src }); } override async test(_version: string): Promise { - await execa(this.name, ['--version'], { stdio: ['inherit', 'inherit', 1] }); + await execa(this.name, ['--version'], { + stdio: ['inherit', 'inherit', 1], + }); } } From 7740aad1b84aa54380672a627c01b01e6dba722a Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Sun, 8 Dec 2024 22:14:25 +0100 Subject: [PATCH 05/12] refactor: use wally-prebuild --- docs/custom-registries.md | 7 +++--- src/cli/tools/wally.ts | 46 ++++++++++++++++++--------------------- test/Dockerfile.distro | 4 ++-- test/latest/Dockerfile | 2 +- 4 files changed, 27 insertions(+), 32 deletions(-) diff --git a/docs/custom-registries.md b/docs/custom-registries.md index 177dfc056..46cf9ca36 100644 --- a/docs/custom-registries.md +++ b/docs/custom-registries.md @@ -588,12 +588,11 @@ https://github.com/vmware-tanzu/carvel-vendir/releases/download/v0.22.0/vendir-l Wally releases are downloaded from: -- `https://github.com/UpliftGames/wally/releases` +- `https://github.com/containerbase/wally-prebuild/releases` Samples: ```txt -https://github.com/UpliftGames/wally/releases/download/v0.3.2/wally-v0.3.2-linux.zip -https://github.com/UpliftGames/wally/releases/download/v0.3.1/wally-0.3.1-linux.zip -https://github.com/UpliftGames/wally/releases/download/v0.3.0/wally-0.3.0-linux.zip +https://github.com/containerbase/wally-prebuild/releases/0.3.2/wally-0.3.2-jammy-x86_x64.tar.xz.sha512 +https://github.com/containerbase/wally-prebuild/releases/0.3.2/wally-0.3.2-jammy-x86_x64.tar.xz ``` diff --git a/src/cli/tools/wally.ts b/src/cli/tools/wally.ts index f188fd90a..76f22e85c 100644 --- a/src/cli/tools/wally.ts +++ b/src/cli/tools/wally.ts @@ -9,12 +9,20 @@ import { HttpService, PathService, } from '../services'; -import { getDistro, parse } from '../utils'; @injectable() export class WallyInstallService extends BaseInstallService { readonly name = 'wally'; + private get ghArch(): string { + switch (this.envSvc.arch) { + case 'arm64': + return 'aarch64'; + case 'amd64': + return 'x86_64'; + } + } + constructor( @inject(EnvService) envSvc: EnvService, @inject(PathService) pathSvc: PathService, @@ -25,34 +33,22 @@ export class WallyInstallService extends BaseInstallService { } override async install(version: string): Promise { - const distro = await getDistro(); - // wally requires libssl3 which is not easily installable on focal - if (distro.versionCode === 'focal') { - throw new Error(`Unsupported distro: ${distro.versionCode}`); - } - - const baseUrl = `https://github.com/UpliftGames/wally/releases/download/v${version}/`; - let filename = `wally-v${version}-linux.zip`; + const name = this.name; + const filename = `${name}-${version}-${this.ghArch}.tar.xz`; + const url = `https://github.com/containerbase/${name}-prebuild/releases/download/${version}/${filename}`; + const checksumFileUrl = `${url}.sha512`; - const ver = parse(version); - // asset names of v0.3.1 and lower are not prefixed with v - if ( - ver.major === 0 && - ver.minor <= 3 && - (ver.minor < 3 || ver.patch <= 1) - ) { - filename = `wally-${version}-linux.zip`; - } + const checksumFile = await this.http.download({ url: checksumFileUrl }); + const expectedChecksum = (await fs.readFile(checksumFile, 'utf-8')).trim(); const file = await this.http.download({ - url: `${baseUrl}${filename}`, + url, + checksumType: 'sha512', + expectedChecksum, }); - await this.pathSvc.ensureToolPath(this.name); - const cwd = path.join( - await this.pathSvc.createVersionedToolPath(this.name, version), - 'bin', - ); - await fs.mkdir(cwd); + + const cwd = await this.pathSvc.ensureToolPath(this.name); + await this.compress.extract({ file, cwd }); } diff --git a/test/Dockerfile.distro b/test/Dockerfile.distro index f34fc82b6..0cfab0bbf 100644 --- a/test/Dockerfile.distro +++ b/test/Dockerfile.distro @@ -116,8 +116,8 @@ RUN install-tool jb v0.6.0 # renovate: datasource=github-releases packageName=vmware-tanzu/carvel-vendir RUN install-tool vendir v0.42.0 -# renovate: datasource=github-releases packageName=UpliftGames/wally -RUN install-tool wally v0.3.2 +# renovate: datasource=github-releases packageName=containerbase/wally-prebuild +RUN install-tool wally 0.3.2 #-------------------------------------- # Image: test-erlang diff --git a/test/latest/Dockerfile b/test/latest/Dockerfile index 987eee9cc..6ce984ff5 100644 --- a/test/latest/Dockerfile +++ b/test/latest/Dockerfile @@ -239,7 +239,7 @@ ARG HELMFILE_VERSION=0.169.2 # renovate: datasource=github-releases depName=kustomize packageName=kubernetes-sigs/kustomize ARG KUSTOMIZE_VERSION=5.5.0 -# renovate: datasource=github-releases packageName=UpliftGames/wally +# renovate: datasource=github-releases packageName=containerbase/wally-prebuild ARG WALLY_VERSION=0.3.2 RUN install-tool vendir "v${VENDIR_VERSION}" From e14b9adbd5ab5f86e2aff95b30967c543d2e2ce6 Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Sun, 8 Dec 2024 22:18:59 +0100 Subject: [PATCH 06/12] chore: reuse var --- src/cli/tools/wally.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli/tools/wally.ts b/src/cli/tools/wally.ts index 76f22e85c..9aed97266 100644 --- a/src/cli/tools/wally.ts +++ b/src/cli/tools/wally.ts @@ -47,7 +47,7 @@ export class WallyInstallService extends BaseInstallService { expectedChecksum, }); - const cwd = await this.pathSvc.ensureToolPath(this.name); + const cwd = await this.pathSvc.ensureToolPath(name); await this.compress.extract({ file, cwd }); } From ac7d0a25454f7895464ab6fbd23c7db26299afa1 Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Tue, 10 Dec 2024 02:23:04 +0100 Subject: [PATCH 07/12] fix(WallyInstallService): add distro to prebuild version --- src/cli/tools/wally.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cli/tools/wally.ts b/src/cli/tools/wally.ts index 9aed97266..dd5d39537 100644 --- a/src/cli/tools/wally.ts +++ b/src/cli/tools/wally.ts @@ -9,6 +9,7 @@ import { HttpService, PathService, } from '../services'; +import { getDistro } from '../utils'; @injectable() export class WallyInstallService extends BaseInstallService { @@ -34,7 +35,8 @@ export class WallyInstallService extends BaseInstallService { override async install(version: string): Promise { const name = this.name; - const filename = `${name}-${version}-${this.ghArch}.tar.xz`; + const distro = await getDistro(); + const filename = `${name}-${version}-${distro.versionCode}-${this.ghArch}.tar.xz`; const url = `https://github.com/containerbase/${name}-prebuild/releases/download/${version}/${filename}`; const checksumFileUrl = `${url}.sha512`; From 3f1f651bad1f3e5c0cf5c82e44c4c931a698f73a Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Thu, 12 Dec 2024 00:27:48 +0100 Subject: [PATCH 08/12] revert: latest distro Docker test --- test/latest/Dockerfile | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/test/latest/Dockerfile b/test/latest/Dockerfile index 6ce984ff5..4763e27cb 100644 --- a/test/latest/Dockerfile +++ b/test/latest/Dockerfile @@ -205,7 +205,7 @@ RUN prepare-tool all RUN set -ex; [ -d /usr/local/erlang ] && echo "works" || exit 1; #-------------------------------------- -# test: bazelisk, bun, devbox, vendir, helmfile, kustomize, skopeo, wally +# test: bazelisk, bun, devbox, vendir, helmfile, kustomize, skopeo #-------------------------------------- FROM base AS teste @@ -239,25 +239,18 @@ ARG HELMFILE_VERSION=0.169.2 # renovate: datasource=github-releases depName=kustomize packageName=kubernetes-sigs/kustomize ARG KUSTOMIZE_VERSION=5.5.0 -# renovate: datasource=github-releases packageName=containerbase/wally-prebuild -ARG WALLY_VERSION=0.3.2 - RUN install-tool vendir "v${VENDIR_VERSION}" RUN install-tool helmfile "v${HELMFILE_VERSION}" RUN install-tool kustomize "${KUSTOMIZE_VERSION}" -RUN install-tool wally "v${WALLY_VERSION}" - RUN set -ex; vendir --version RUN set -ex; helmfile version RUN set -ex; kustomize version -RUN set -ex; wally --version - SHELL [ "/bin/sh", "-c" ] RUN vendir --version | grep "${VENDIR_VERSION}" @@ -266,8 +259,6 @@ RUN helmfile version | grep "${HELMFILE_VERSION}" RUN kustomize version | grep "${KUSTOMIZE_VERSION}" -RUN wally --version | grep "${WALLY_VERSION}" - USER 12021 RUN bazel --version @@ -278,8 +269,6 @@ RUN helmfile version | grep "${HELMFILE_VERSION}" RUN kustomize version | grep "${KUSTOMIZE_VERSION}" -RUN wally --version | grep "${WALLY_VERSION}" - #-------------------------------------- # final #-------------------------------------- From fc1ac15515b877dcb17873219d24ed89d1841d13 Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Thu, 12 Dec 2024 09:48:41 +0100 Subject: [PATCH 09/12] Update docs/custom-registries.md --- docs/custom-registries.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/custom-registries.md b/docs/custom-registries.md index 46cf9ca36..2a2f1503f 100644 --- a/docs/custom-registries.md +++ b/docs/custom-registries.md @@ -593,6 +593,6 @@ Wally releases are downloaded from: Samples: ```txt -https://github.com/containerbase/wally-prebuild/releases/0.3.2/wally-0.3.2-jammy-x86_x64.tar.xz.sha512 -https://github.com/containerbase/wally-prebuild/releases/0.3.2/wally-0.3.2-jammy-x86_x64.tar.xz +https://github.com/containerbase/wally-prebuild/releases/download/0.3.2/wally-0.3.2-jammy-x86_x64.tar.xz.sha512 +https://github.com/containerbase/wally-prebuild/releases/download/0.3.2/wally-0.3.2-jammy-x86_x64.tar.xz ``` From 941388fb6f8dfd302d3f2e632664d20c84fdc3e5 Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Thu, 12 Dec 2024 09:55:49 +0100 Subject: [PATCH 10/12] test: add arm64 test --- test/latest/Dockerfile.arm64 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/latest/Dockerfile.arm64 b/test/latest/Dockerfile.arm64 index fa2301163..b46ed9560 100644 --- a/test/latest/Dockerfile.arm64 +++ b/test/latest/Dockerfile.arm64 @@ -134,6 +134,9 @@ RUN install-tool skopeo 1.17.0 # renovate: datasource=github-releases packageName=getsops/sops RUN install-tool sops v3.9.2 +# renovate: datasource=github-releases packageName=containerbase/wally-prebuild +RUN install-tool wally 0.3.2 + #-------------------------------------- # Image: final #-------------------------------------- From 964024113026e92253e419b6f428a47a468c5fa8 Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Fri, 20 Dec 2024 23:05:12 +0100 Subject: [PATCH 11/12] fix(WallyInstallService): add noble workaround --- src/cli/tools/wally.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/cli/tools/wally.ts b/src/cli/tools/wally.ts index dd5d39537..c64f62a0a 100644 --- a/src/cli/tools/wally.ts +++ b/src/cli/tools/wally.ts @@ -9,7 +9,7 @@ import { HttpService, PathService, } from '../services'; -import { getDistro } from '../utils'; +import { getDistro, logger } from '../utils'; @injectable() export class WallyInstallService extends BaseInstallService { @@ -36,6 +36,12 @@ export class WallyInstallService extends BaseInstallService { override async install(version: string): Promise { const name = this.name; const distro = await getDistro(); + let code = distro.versionCode; + + if (code === 'noble') { + logger.debug(`Using jammy prebuild for ${name} on ${code}`); + code = 'jammy'; + } const filename = `${name}-${version}-${distro.versionCode}-${this.ghArch}.tar.xz`; const url = `https://github.com/containerbase/${name}-prebuild/releases/download/${version}/${filename}`; const checksumFileUrl = `${url}.sha512`; From 4b8dbc7ad9dfb76be4ce93a936554fb5eeb8c7e3 Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Fri, 20 Dec 2024 23:07:57 +0100 Subject: [PATCH 12/12] fix(WallyInstallService): actually use code --- src/cli/tools/wally.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli/tools/wally.ts b/src/cli/tools/wally.ts index c64f62a0a..7d6fce168 100644 --- a/src/cli/tools/wally.ts +++ b/src/cli/tools/wally.ts @@ -42,7 +42,7 @@ export class WallyInstallService extends BaseInstallService { logger.debug(`Using jammy prebuild for ${name} on ${code}`); code = 'jammy'; } - const filename = `${name}-${version}-${distro.versionCode}-${this.ghArch}.tar.xz`; + const filename = `${name}-${version}-${code}-${this.ghArch}.tar.xz`; const url = `https://github.com/containerbase/${name}-prebuild/releases/download/${version}/${filename}`; const checksumFileUrl = `${url}.sha512`;