-
Notifications
You must be signed in to change notification settings - Fork 2k
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
artifacts: does not automatically unpack .tar archives #2443
Comments
Hey can you file and cross link against https://github.com/hashicorp/go-getter |
go-getter issue: hashicorp/go-getter#19 |
AFAICT, this is still an issue in that Nomad does not yet support unpacking @dadgar, does nomad support decompressing |
This was a very old bug that got re-opened, so I wanted to make sure it hadn't been opened accidentally. But I was able to confirm this is still broken! The specific behavior is with uncompressed artifact to run#!/usr/bin/env sh
while :
do
echo "sleeping..."
sleep 2
done On our Vagrant development box, you can prep this artifact to be served as follows: tar -cf sleeper.tar ./sleeper.sh
tar -czf sleeper.tar.gz ./sleeper.sh
sudo mkdir -p /srv/artifacts
sudo mv sleeper.tar* /srv/artifacts Run the artifact server: jobspec for an artifact serverjob "artifacts" {
datacenters = ["dc1"]
type = "system"
group "artifacts" {
network {
mode = "bridge"
port "www" {
static = 15101
to = 8000
}
}
task "httpd" {
driver = "docker"
config {
image = "busybox:1"
command = "httpd"
args = [
"-v", "-f",
"-p", "8000",
"-u", "www-data:www-data",
"-h", "/srv",
"-r", "artfiacts",
"-c", "/local/httpd.conf",
]
mount {
type = "bind"
target = "/srv"
source = "/srv/artifacts"
readonly = true
}
ports = ["www"]
}
template {
# HTTP Basic Auth username: "artifacts", password: "supersecret"
data = <<EOT
/:artifacts:$1$iSV64UXs$IWot5UKWBzka6VskUSFWm0
EOT
destination = "local/httpd.conf"
}
resources {
cpu = 128
memory = 128
}
}
}
} And then try to run the following job: jobspec that uses this artifactlocals {
auth_header = base64encode("artifacts:supersecret")
}
job "example" {
datacenters = ["dc1"]
group "sleeper" {
task "sleeper" {
artifact {
source = "http://localhost:15101/sleeper.tar"
# but .tar.gz works:
# source = "http://localhost:15101/sleeper.tar.gz"
headers {
Authorization = "Basic ${local.auth_header}"
}
}
driver = "exec"
config {
command = "/local/sleeper.sh"
}
}
}
} If the |
Yay! Thank you! |
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. |
Nomad version
Nomad v0.5.4
Operating system and Environment details
Ubuntu
Issue
Does not unpack .tar, only zipped archives.
Expected behaviour: also unpack .tar archives
Reproduction steps
The text was updated successfully, but these errors were encountered: