cloudfoundry-incubator / fissile

Turn a BOSH release into container images / files
Apache License 2.0
67 stars 36 forks source link

docker run example for nats-release fails: cannot access '/usr/local/bin/create-release.sh': No such file or directory #517

Open drnic opened 5 years ago

drnic commented 5 years ago

https://github.com/cloudfoundry-incubator/fissile/blob/develop/docs/configuration.md#building-the-nats-image contains a docker run command that fails. What is the correct command for the image?

$ docker run --rm \
    --volume "${HOME}/.bosh/cache:/bosh-cache" \
    --volume "${PWD}/nats-release:${PWD}/nats-release" \
    --env "RUBY_VERSION=2.2.3" \
    splatform/bosh-cli \
    /usr/local/bin/create-release.sh \
        "$(id -u)" "$(id -g)" /bosh-cache --dir "${PWD}/nats-release" --force --name "nats"
docker: Error response from daemon: OCI runtime create failed: container_linux.go:345: starting container process caused "exec: \"/usr/local/bin/create-release.sh\": stat /usr/local/bin/create-release.sh: no such file or directory": unknown.

I found a bosh.sh and quickly tried /usr/local/bin/bosh.sh create-release but it failed a different way:

docker run --rm \
    --volume "${HOME}/.bosh/cache:/bosh-cache" \
    --volume "${PWD}/nats-release:${PWD}/nats-release" \
    --env "RUBY_VERSION=2.2.3" \
    splatform/bosh-cli \
    /usr/local/bin/bosh.sh create-release \
        "$(id -u)" "$(id -g)" /bosh-cache --dir "${PWD}/nats-release" --force --name "nats"
/usr/local/bin/bosh.sh: line 27: addgroup: command not found
drnic commented 5 years ago

Is this docker command interchangeable with locally running cd nats-release && bosh create-release?

jandubois commented 5 years ago

I think it is, but I wonder why you spend effort on what is essentially legacy cruft; this should probably be deleted from the documentation.

This functionality was used by SCF v1 and v2, when most bosh releases were git submodules inside the SCF repo. This is no longer the case; I think the only release still build with this mechanism is scf-release itself. All other releases are downloaded from either bosh.io, or from some other S3 buckets.

Also, in case this is not clear, most of the fissile functionality is only used by SCF v2. The only command needed for SCF v3/Quarks is fissile build release-image which turns a bosh release into a container image (one image per release, as opposed to the huge shared base-layer images used by v2).

So if you are only interested in Quarks, then you don't really care about all the other stuff (like role manifests). I kind of wish we had implemented fissile build release-image as a separate tool; it is only a subcommand because it re-uses a lot of the fissile code for building v2 images.

drnic commented 5 years ago

I was just trying to use fissile for the first time and was following along the documentation.

drnic commented 5 years ago

Yes I’m only interested in the new Quarks world. Thanks for “fissile build release-image”

I’ll go hunting for another getting started tutorial. Is there one you can link me?

drnic commented 5 years ago

I'll start with https://github.com/SUSE/nats-container-deployment.

Edit: Nope, that looks like a pre-Quarks project too. https://github.com/SUSE/nats-container-deployment/issues/10

drnic commented 5 years ago

For future me/others who accidentally try these old instructions, I got the following demo to work:

mkdir -p ~/workspace/redis
cd ~/workspace/redis
fissile build release-images --stemcell splatform/fissile-stemcell-opensuse:42.3-38.g82067a9-30.95 --name redis-boshrelease:15.3.3 --url https://github.com/cloudfoundry-community/redis-boshrelease/releases/download/v15.3.3/redis-15.3.3.tgz --sha1 022d18e68627549bb0a7fc50a9f22e54fe5307f9 --version 15.3.3 -w $PWD

docker run -ti redis:opensuse-42.3-38.g82067a9-30.95-7.0.0_354.gacefcfa4-15.3.3 /var/vcap/packages/redis-4/bin/redis-cli -v

As suggested https://github.com/cloudfoundry-incubator/cf-operator-ci/blob/master/pipelines/release-images/tasks/build.sh#L32-L34, I then re-tagged the image with an organization and pushed to docker hub cfcommunity/redis:opensuse-42.3-38.g82067a9-30.95-7.0.0_354.gacefcfa4-15.3.3

drnic commented 5 years ago

This issue can be closed if current docs are all deprecated/not expected to work for new users.