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

fix: python docker build architecture #1082

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
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
11 changes: 9 additions & 2 deletions platform/src/components/aws/function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import {
import { Permission, permission } from "./permission.js";
import { Vpc } from "./vpc.js";
import { buildPython, buildPythonContainer } from "../../runtime/python.js";
import { Image } from "@pulumi/docker-build";
import { Image, Platform } from "@pulumi/docker-build";
import { rpc } from "../rpc/rpc.js";

/**
Expand Down Expand Up @@ -1593,6 +1593,13 @@ export class Function extends Component implements Link.Linkable {
registryId: bootstrapData.assetEcrRegistryId,
});

const archPlatformMap: Record<string, Platform> = {
"arm64": "linux/arm64",
"x86_64": "linux/amd64"
}

const platforms = architectures.apply((architectures) => architectures.map((arch) => archPlatformMap[arch]))

// build image
//aws-python-container::sst:aws:Function::MyPythonFunction
return new Image(
Expand Down Expand Up @@ -1627,7 +1634,7 @@ export class Function extends Component implements Link.Linkable {
inline: {},
},
],
/// TODO: walln - enable arm64 builds by using architecture args
platforms,
push: true,
registries: [
authToken.apply((authToken) => ({
Expand Down