Skip to content

Commit

Permalink
Merge pull request #6477 from jandubois/download-wasm-shim
Browse files Browse the repository at this point in the history
Download containerd-shim-spin-v2 → resources/linux/internal
  • Loading branch information
mook-as authored Feb 14, 2024
2 parents 62807cb + 439701c commit 9f2a1cc
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 4 deletions.
4 changes: 0 additions & 4 deletions .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ appimagekit
APPLEID
APPLICATIONFOLDER
AProject
aquasecurity
ARPNOMODIFY
ARPPRODUCTICON
ARPURLINFOABOUT
Expand All @@ -48,7 +47,6 @@ autocrlf
auxww
Awop
AWorkspace
awslabs
azuread
azureaks
azurestorage
Expand Down Expand Up @@ -251,7 +249,6 @@ ficlone
filekey
filestat
fineprint
flavio
fleetworkspace
Fluentd
FOLDERID
Expand Down Expand Up @@ -812,7 +809,6 @@ winio
winthrop
wix
wixobj
wixtoolset
WIXUI
wontfix
wordpress
Expand Down
3 changes: 3 additions & 0 deletions .github/actions/spelling/patterns.txt
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,6 @@ regexp?\.MustCompile\(`[^`]*`\)

# on macOS, MacOS is used for the internal folder name within an app...
(["/])MacOS\g{-1}

# GitHub owner names should not be checked (dependency scripts)
\bgithubOwner\s*=\s*'.*?'
1 change: 1 addition & 0 deletions pkg/rancher-desktop/assets/dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ mobyOpenAPISpec: "1.44"
wix: "314"
hostSwitch: 1.2.0
moproxy: 0.5.0
wasmShims: 0.10.0
27 changes: 27 additions & 0 deletions scripts/dependencies/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -558,3 +558,30 @@ export class ECRCredHelper implements Dependency, GitHubDependency {
return semver.rcompare(version1, version2);
}
}

export class SpinShim implements Dependency, GitHubDependency {
name = 'containerd-shim-spin-v2';
githubOwner = 'deislabs';
githubRepo = 'containerd-wasm-shims';

async download(context: DownloadContext): Promise<void> {
const arch = context.isM1 ? 'aarch64' : 'x86_64';
const base = `https://github.com/${ this.githubOwner }/${ this.githubRepo }/releases/download/v${ context.versions.wasmShims }`;
const url = `${ base }/containerd-wasm-shims-v2-spin-linux-${ arch }.tar.gz`;
const destPath = path.join(context.resourcesDir, 'linux', 'internal', this.name);

await downloadTarGZ(url, destPath);
}

async getAvailableVersions(includePrerelease = true): Promise<string[]> {
return await getPublishedVersions(this.githubOwner, this.githubRepo, includePrerelease);
}

versionToTagName(version: string): string {
return `v${ version }`;
}

rcompareVersions(version1: string, version2: string): -1 | 0 | 1 {
return semver.rcompare(version1, version2);
}
}
1 change: 1 addition & 0 deletions scripts/lib/dependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export type DependencyVersions = {
wix: string;
hostSwitch: string;
moproxy: string;
wasmShims: string;
};

export async function readDependencyVersions(path: string): Promise<DependencyVersions> {
Expand Down
1 change: 1 addition & 0 deletions scripts/postinstall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const wslDependencies = [
// Dependencies that are specific to WSL and Lima VMs.
const vmDependencies = [
new tools.Trivy(),
new tools.SpinShim(),
];

// Dependencies that are specific to hosts.
Expand Down
1 change: 1 addition & 0 deletions scripts/rddepman.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const dependencies: Dependency[] = [
new MobyOpenAPISpec(),
new HostSwitch(),
new Moproxy(),
new tools.SpinShim(),
];

function git(...args: string[]): number | null {
Expand Down

0 comments on commit 9f2a1cc

Please sign in to comment.