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

Add support for specific Docker tag in spawn_data_pipeline.py #553

Merged
merged 3 commits into from Jun 6, 2019
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 20 additions & 0 deletions infra/spawn_data_pipeline.py
Expand Up @@ -69,6 +69,8 @@ def main():

id_mapping = {}

docker_tag = os.getenv("TAG", None)

# First pass, do the template rendering and dependencies resolution
tasks = []

Expand Down Expand Up @@ -105,6 +107,24 @@ def main():

payload["dependencies"] = new_dependencies

# Override the Docker image tag if needed
if docker_tag:
base_image = payload["payload"]["image"]
splitted_image = base_image.rsplit(":", 1)

# If we have already a Docker tag
if len(splitted_image) > 1:
docker_tag = splitted_image

if docker_tag != "latest":
msg = "Don't update image {} for task {} as its already has a tag"
Lothiraldan marked this conversation as resolved.
Show resolved Hide resolved
print(msg.format(base_image, task_internal_id))

tagless_image = splitted_image[0]

new_image = "{}:{}".format(tagless_image, docker_tag)
payload["payload"]["image"] = new_image

tasks.append((task_id, payload))

# Now sends them
Expand Down