Skip to content

Commit

Permalink
Add arm64 platform support to dagster-cloud.pex, do the build inside …
Browse files Browse the repository at this point in the history
…a manylinux builder image

Summary:
Add an arm64 platform to the dagster-cloud.pex - it no longer builds locally, so do it in Docker now.

Test Plan;
Make a v0.1.48 release
  • Loading branch information
gibsondan committed Oct 31, 2024
1 parent 3d47d05 commit 405c61a
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 4 deletions.
Binary file modified generated/gha/dagster-cloud.pex
Binary file not shown.
16 changes: 16 additions & 0 deletions scripts/Dockerfile.dagster-cloud-pex-builder
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Builds generated/gha/dagster-cloud.pex

# Use an official manylinux builder (https://github.com/pypa/manylinux#docker-images)
FROM --platform=linux/amd64 quay.io/pypa/manylinux_2_28_x86_64:latest

# Add all the relevant Python binaries to the PATH
ENV PATH="/opt/python/cp38-cp38/bin:/opt/python/cp39-cp39/bin:/opt/python/cp310-cp310/bin:/opt/python/cp311-cp311/bin:/opt/python/cp311-cp312/bin:$PATH"

# pins?
RUN python3.11 -m pip install typer rich pex

COPY release.py release.py

RUN mkdir -p /generated

CMD ["python3.11", "release.py", "build-dagster-cloud-pex"]
45 changes: 41 additions & 4 deletions scripts/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def build_docker_action(version_tag: str, publish_docker_action: bool = True):


@app.command(help="Build dagster-cloud.pex")
def update_dagster_cloud_pex(
def build_dagster_cloud_pex(
dagster_internal_branch: Optional[str] = DAGSTER_INTERNAL_BRANCH_OPTION,
dagster_oss_branch: Optional[str] = DAGSTER_OSS_BRANCH_OPTION,
):
Expand Down Expand Up @@ -123,13 +123,13 @@ def update_dagster_cloud_pex(
"PyGithub",
"-o=dagster-cloud.pex",
*platform_args,
"--platform=macosx_12_0_x86_64-cp-311-cp311",
"--platform=macosx_12_0_arm64-cp-311-cp311",
# For arm64 github runners
"--platform=manylinux_2_17_aarch64-cp-312-cp312",
"--pip-version=23.0",
"--resolver-version=pip-2020-resolver",
"--venv=prepend",
"--python-shebang=/usr/bin/env python",
"-v",
"-vvvvv",
]
print(f"Running {args}")
output = subprocess.check_output(
Expand All @@ -142,6 +142,43 @@ def update_dagster_cloud_pex(
info("Built generated/gha/dagster-cloud.pex")


@app.command(help="Update dagster-cloud.pex")
def update_dagster_cloud_pex(
dagster_internal_branch: Optional[str] = DAGSTER_INTERNAL_BRANCH_OPTION,
dagster_oss_branch: Optional[str] = DAGSTER_OSS_BRANCH_OPTION,
):
map_folders = {"/generated": os.path.join(os.path.dirname(__file__), "..", "generated")}

mount_args = []
for target_folder, source_folder in map_folders.items():
mount_args.extend(["--mount", f"type=bind,source={source_folder},target={target_folder}"])

cmd = [
"docker",
"build",
"--progress=plain",
"-t",
"dagster-cloud-pex-builder",
"--platform=linux/amd64",
"-f",
os.path.join(os.path.dirname(__file__), "Dockerfile.dagster-cloud-pex-builder"),
os.path.dirname(__file__),
]

subprocess.run(cmd, check=True)

# Map generated to generated on docker image and build!
cmd = [
"docker",
"run",
"--platform=linux/amd64",
*mount_args,
"-t",
"dagster-cloud-pex-builder",
]
subprocess.run(cmd, check=True)


@app.command()
def update_docker_action_references(
previous_version_tag,
Expand Down

0 comments on commit 405c61a

Please sign in to comment.