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

Dynamic Jobs force "docker-image" Jobs Context to Output Folder #424

Open
calvinmorrow opened this issue Sep 10, 2020 · 0 comments
Open

Comments

@calvinmorrow
Copy link

calvinmorrow commented Sep 10, 2020

Describe the bug
Dynamic jobs created via an output to /infrabox/output/infrabox.json force future docker-image jobs to lose Git context by binding /infrabox/context to /data/repo/.infrabox/output

To Reproduce

  1. Create a dynamic job by copying an infrabox.json file to /infrabox/output/infrabox.json with a docker-image type job.
  2. Git repo is cloned like normal
  3. Git context is inaccessible because docker mounts are as follows:
        "Mounts": [
            {
                "Type": "bind",
                "Source": "/data/repo/.infrabox",
                "Destination": "/infrabox",
                "Mode": "",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/data/repo/.infrabox/output",
                "Destination": "/infrabox/context",
                "Mode": "",
                "RW": true,
                "Propagation": "rprivate"
            }
        ],

Expected behavior
Normal docker-image jobs would have context set to the git repo (/data/repo). Context is empty unless other files are copied to /infrabox/output

I am assuming this is unintended behavior. At the least it seems undocumented behavior. Context is set in job.py to the Infrabox output folder in https://github.com/SAP/InfraBox/blob/master/src/job/job.py#L445-L454.

Our use case was to write a tool that would run workflows (specific infrabox.json files) on specific branches. If the branch matched, the file was copied to /infrabox/output/infrabox.json (ie: master or release branch workflows). Unfortunately the workflows subsequently failed because the git repo was inaccessible to the dynamically created jobs.

Clarifying that this issue primarily affects docker-image jobs since in docker jobs the build_context can be changed (to ../.. in most examples I've seen) which I don't believe is possible with docker-image

@calvinmorrow calvinmorrow changed the title Dynamic Jobs force Context to Output Folder Dynamic Jobs force "docker-image" Jobs Context to Output Folder Sep 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant