Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download containerd-shim-spin-v2 → resources/linux/internal #6477

Merged
merged 2 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
jandubois marked this conversation as resolved.
Show resolved Hide resolved
}

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(),
jandubois marked this conversation as resolved.
Show resolved Hide resolved
];

// 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
Loading