Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

dgr push does not use aci version information #189

Open
BenjaminHerbert opened this issue Aug 15, 2016 · 7 comments
Open

dgr push does not use aci version information #189

BenjaminHerbert opened this issue Aug 15, 2016 · 7 comments

Comments

@BenjaminHerbert
Copy link

For a continuous delivery pipeline, I want to be able to set the aci-version at build time to an arbitrary value.

Guided by this example, I added a runlevels/build/10.install.sh script that contains:

cat > /dgr/builder/attributes/version.yml <<EOF
default:
  version: $VERSION
EOF

and used a placeholder in the aci-manifest.yml:

name: aci.example.com/aci-dummy:{{.version}}

When I run dgr clean push --set-env=VERSION=1.2.3, the build is working as intented and creates an ACI named aci.example.com/aci-dummy:1.2.3

However, the push does not seem to pick up the version, it tries to works on aci.example.com/aci-dummy:<no value> instead.

@n0rad
Copy link
Member

n0rad commented Aug 16, 2016

Run it as 2 separate commands for the moment

$ dgr clean build --set-env=VERSION=1.2.3
$ dgr push

I will have a look

@BenjaminHerbert
Copy link
Author

Thanks for having a look.

Is it supposed to work at all this way? Maybe my assumptions are wrong.

Here are some further observations.
All log statements (regardless of build or push) show:

aci=aci.dvag.net/aci-dummy:

The log statement that shows a version is stated in the build step.

11:13:23 INFO dgr/bin-dgr/aci-build.go:90 Finished building aci
fullname=aci.dvag.net/aci-dummy:1.2.3

This seems to be created in bin-dgr/aci-build.go

fullname := common.ExtractNameVersionFromManifest(im)
logs.WithField("fullname", *fullname).Info("Finished building aci")

The other entries seem to be generated by a statement like: logs.WithF(aci.fields).Info("Gzipping aci")`
as in bin-dgr/aci-sign.go.

What I noticed is, that for build, the log output states:

11:13:23 DEBUG d/a/bin-run/builder.go:108 Merged attributes for manifest templating aci=aci-dummy attributes=map[version:1.2.3]
11:13:23 DEBUG d/b/common/dgr-manifest.go:112 Templated manifest content=name: aci.example.com/aci-dummy:1.2.3

for push, it states:

11:13:40 DEBUG d/b/common/dgr-manifest.go:112 Templated manifest content=name: aci.example.com/aci-dummy:

It seems like the template is not working in the push step.

@n0rad
Copy link
Member

n0rad commented Aug 17, 2016

Are you talking about dgr clean push or dgr build && dgr push ?

It's normal that during the build logs are using aci-dummy:<no value> since the version is defined by the build itself. -> #190

@BenjaminHerbert
Copy link
Author

I was running it as dgr build && dgr push.

@n0rad
Copy link
Member

n0rad commented Aug 26, 2016

I have just tested with acserver and it's working.

Does #190 confuse you on the source of the problem ?

@BenjaminHerbert
Copy link
Author

Yes, I was confused by the log output.

I checked again, using the instructions listed here: https://github.com/blablacar/dgr#push-an-aci-and-run-from-repository.

Build & push now works either way:
./dgr clean build --set-env=VERSION=1.2.3 && ./dgr push
or
./dgr clean push --set-env=VERSION=1.2.3.

I checked the (locally) uploaded aci with: tar xf /tmp/acis/aci-dummy-latest-linux-amd64.aci manifest -O | grep -m1 version -C2. It correctly shows version 1.2.3.

So this issue is fixed. Thank you very much!

One further question: the uploaded aci (within acserver) showed up aci-dummy-latest-linux-amd64.aci, whereas I have expected to find aci-dummy-1.2.3-linux-amd64.aci on the acserver.

Fetching the image with rkt fetch --insecure-options http,image --no-store aci.dvag.net/aci-dummy:latest and fetches the aci and rkt image list then displays aci.dvag.net/aci-dummy:1.2.3.
Where does the latest come from?

@BenjaminHerbert
Copy link
Author

I can see a request made to:
POST /aci-dummy-latest-linux-amd64.aci/startupload HTTP/1.1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants