Skip to content

Commit b44111d

Browse files
authored
Change defaults build method for deploy_pex.py (#218)
* Change defaults build method for deploy_pex.py ubuntu-20.04 is deprecated and we can now run wheels built on ubuntu-22.04 so we need the docker fallback. * Update deploy_pex.py - also dont fallback for 20.04
1 parent 9388b04 commit b44111d

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

src/deploy_pex.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
#!/usr/bin/env python
22

33
# Switches PEX deploy behavior based on github runner's ubuntu version
4-
# - ubuntu-20.04 can always build pexes that work on our target platform
5-
# - ubuntu-22.04 can only build pexes if there are no sdists (source only packages)
4+
# - ubuntu-22.04 can always build pexes that work on our target platform
5+
# - newer versions of ubuntu can only build pexes if there are no sdists (source only packages)
66

7-
# On ubuntu-20.04: forward args to `dagster-cloud --build-method=local`
8-
# On ubuntu-22.04: forward args to `dagster-cloud --build-method=docker`
9-
# - Sometimes 22.04 may try to build sdists but build the wrong version (since we are not yet
10-
# using --complete-platform for pex). To avoid this situation, we always build dependencies in the
11-
# right docker environment on 22.04. Note if dependencies are not being built, docker will not
12-
# be used. The source.pex is always built using the local environment.
7+
# On ubuntu-22.04: forward args to `dagster-cloud --build-method=local`
8+
# On anything else: forward args to `dagster-cloud --build-method=docker` to ensure they are built in a compatible environment
139

1410
import os
1511
import re
@@ -39,7 +35,7 @@ def main():
3935

4036
ubuntu_version = get_runner_ubuntu_version()
4137
print("Running on Ubuntu", ubuntu_version, flush=True)
42-
if ubuntu_version == "20.04":
38+
if ubuntu_version == "22.04" or ubuntu_version == "20.04":
4339
returncode, output = deploy_pex(args, deployment_name, build_method="local")
4440
else:
4541
returncode, output = deploy_pex(args, deployment_name, build_method="docker")
@@ -61,7 +57,7 @@ def get_runner_ubuntu_version():
6157
for line in release_info.splitlines(keepends=False):
6258
if line.startswith("DISTRIB_RELEASE="):
6359
return line.split("=", 1)[1]
64-
return "22.04" # fallback to safer behavior
60+
return "24.04" # fallback to safer behavior
6561

6662

6763
def get_locations(dagster_cloud_file) -> List[str]:

0 commit comments

Comments
 (0)