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

interpolation does not work for destination in artifact stanza #6929

Closed
Fuco1 opened this issue Jan 11, 2020 · 7 comments · Fixed by #9671
Closed

interpolation does not work for destination in artifact stanza #6929

Fuco1 opened this issue Jan 11, 2020 · 7 comments · Fixed by #9671
Labels
stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/artifact type/bug

Comments

@Fuco1
Copy link
Contributor

Fuco1 commented Jan 11, 2020

Copy of now closed #2752

Nomad version

Nomad v0.9.5

Operating system and Environment details

CentOS Linux release 7.3.1611 (Core)

Issue

interpolation does not work in artifact { destination = "destination" } stanza

Reproduction steps

create job with example from "Job file section"

nomad validate and nomad run executes with no errors.

nomad status -verbose example shows that download has been completed and task started
but as you can see from logs, task is terminated because, in my case, start script expected to be in /tmp/example-job/start.sh

Checking content of allocation on node that was assigned to run a task:

ls your_nomad_allocation_dir

...
...
drwxr-xr-x   3 root   root      17 Jun 28 13:08 ${NOMAD_META_DESTINATION_DIR}
...

Nomad Server logs

$ nomad validate example.nomad
Job validation successful

Nomad Client logs

06/28/17 13:08:44 PDT  Restarting             Task restarting in 27.305774574s
06/28/17 13:08:44 PDT  Terminated             Exit Code: 1
06/28/17 13:08:44 PDT  Started                Task started by client
06/28/17 13:08:26 PDT  Downloading Artifacts  Client is downloading artifacts

Job file

job "example" {
.....
  meta {
     DESTINATION_DIR = "/tmp/example-job"
     SOURCE_URL = "https://example_url/example.tar.gz"
  }
....
  task "task" {
....
     artifact {
        source = "${NOMAD_META_SOURCE_URL}"
        destination = "${NOMAD_META_DESTINATION_DIR}"
     }
.....
}
@tgross tgross added this to the unscheduled milestone Jan 13, 2020
@tgross
Copy link
Member

tgross commented Jan 13, 2020

Thanks for re-creating this one, @Fuco1. I noticed you changed the version to 0.9.5 from the original issue; are you experiencing this problem with 0.9.5?

@Fuco1
Copy link
Contributor Author

Fuco1 commented Jan 13, 2020

@tgross yes indeed, I'm using 0.9.5. My OS is also different (ubuntu 16.04 if I'm not mistaken) but that shouldn't play a big role. But if necessary I can check exact build when I get to the office.

Edit: the repro steps are the same.

@02strich
Copy link
Contributor

02strich commented Mar 9, 2020

I don't think this is supported at this point. Looking at https://github.com/hashicorp/nomad/blob/master/client/allocrunner/taskrunner/getter/getter.go#L100 the destination is taken as is and never interpolated. @tgross do you think this should be working already?

@stale
Copy link

stale bot commented Jun 7, 2020

Hey there

Since this issue hasn't had any activity in a while - we're going to automatically close it in 30 days. If you're still seeing this issue with the latest version of Nomad, please respond here and we'll keep this open and take another look at this.

Thanks!

@Fuco1
Copy link
Contributor Author

Fuco1 commented Jun 7, 2020

@Stale this is still an issue

@kung-foo
Copy link

kung-foo commented Sep 8, 2020

Still an issue with Nomad v0.11.3 (8918fc804a0c6758b6e3e9960e4eb2e605e38552)

@tgross tgross added the stage/accepted Confirmed, and intend to work on. No timeline committment though. label Sep 9, 2020
schmichael added a commit that referenced this issue Nov 18, 2020
schmichael added a commit that referenced this issue Nov 18, 2020
cgbaker added a commit that referenced this issue Dec 17, 2020
cgbaker added a commit that referenced this issue Dec 22, 2020
resolves #9839
resolves #6929
resolves #6910

e2e: template env interpolation path testing
cgbaker added a commit that referenced this issue Jan 4, 2021
resolves #9839
resolves #6929
resolves #6910

e2e: template env interpolation path testing
backspace pushed a commit that referenced this issue Jan 22, 2021
resolves #9839
resolves #6929
resolves #6910

e2e: template env interpolation path testing
@github-actions
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/artifact type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants