HomeElementl

Build images from the correct path

Description

Build images from the correct path

Summary:
When releasing 0.11.10, we weren't able to build user-code-example
because git_repo_root() was evaluating relative to where the release
pipeline was running instead of relative to where the image definition
lived. So instead of trying to copy:

DAGSTER_REPO/examples/deploy_k8s/example_project

it was trying to copy:

SOME_OTHER_REPO/examples/deploy_k8s/example_project

This adds the flexiblity for git_repo_root() to work against an
injected path - in this case, cwd (which is already set to the image's
path).

Additionally, the try/finally was starting after the destination
directory was created and also after some invariant checks. If an
invariant check failed, the destination directory would never be cleaned
up and subsequent runs would fail because os.mkdir() would try to make
a directory that already exists. This commit fixes that behavior so that
the destination directory is always cleaned up.

Test Plan: unit

Reviewers: owen, alangenfeld, max

Reviewed By: alangenfeld

Differential Revision: https://dagster.phacility.com/D8031

Details

Provenance
jordansandersAuthored on May 21 2021, 5:51 PM
Reviewer
alangenfeld
Differential Revision
D8031: Build images from the correct path
Parents
R1:fa6a1bfdd5b0: add log capture event
Branches
Unknown
Tags
Unknown