generate-tools ignores 2.x agents and creates bad path

Bug #1613858 reported by Curtis Hovey
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
Critical
Katherine Cox-Buday

Bug Description

Since this bug was reported, the generate-tools behaviour is almost correct. The remaining problem is that the --streams option does not work exactly as --help states, and when something is wrong, juju silently goes to streams.canonical.com instead explaining that agents were not found and exiting with an error. When juju falls back to streams.canonical.com, it does not download agents. the streams are useless.

Fix this bug by making juju exit with an error if the expected dir is missing or there are no agents in the dir.

"""
Tools tarballs can are located in either a sub directory called "releases" (legacy),
or a directory named after the stream. By default, if no --stream argument is provided,
metadata for tools in the "released" stream is generated by scanning for tool tarballs
in the "releases" directory.
"""

Juju 2 doesn't really have "releases" like juju 1 did. For extra credit, make "released" the default dir since it is the default agent-streams so that there is a one-to-one relationship between the location of the agents and the selected agent-streams so that juju just works.

Curtis Hovey (sinzui)
tags: added: streams
tags: added: simplestreams
affects: juju-core → juju
Changed in juju:
milestone: 2.0-beta17 → none
milestone: none → 2.0-beta17
Curtis Hovey (sinzui)
description: updated
Curtis Hovey (sinzui)
Changed in juju:
milestone: 2.0-beta17 → 2.0-beta18
Curtis Hovey (sinzui)
Changed in juju:
milestone: 2.0-beta18 → 2.0-beta19
Changed in juju:
milestone: 2.0-beta19 → 2.0-rc1
Changed in juju:
milestone: 2.0-rc1 → 2.0.0
Changed in juju:
assignee: nobody → Richard Harding (rharding)
Changed in juju:
importance: High → Critical
tags: added: rteam
Curtis Hovey (sinzui)
Changed in juju:
milestone: 2.0-rc3 → 2.0.0
Changed in juju:
status: Triaged → In Progress
assignee: Richard Harding (rharding) → Nate Finch (natefinch)
Revision history for this message
Nate Finch (natefinch) wrote :
Download full text (3.8 KiB)

I can't reproduce this. It seems to work fine for me:

└── mystreams
    └── tools
        ├── devel
        │   ├── fix-ppc.tgz
        │   ├── juju-1.25.5.1-trusty-ppc64el.tgz
        │   ├── juju-1.25.5.2-trusty-ppc64el.tgz
        │   └── juju-2.0.0-xenial-amd64.tgz
        └── streams
            └── v1
                ├── com.ubuntu.juju-devel-tools.json
                └── index2.json

$ more mystreams/tools/streams/v1/com.ubuntu.juju-devel-tools.json
{
    "products": {
        "com.ubuntu.juju:14.04:ppc64": {
            "version": "1.25.5.1",
            "arch": "ppc64",
            "versions": {
                "20161012": {
                    "items": {
                        "1.25.5.1-trusty-ppc64": {
                            "release": "trusty",
                            "version": "1.25.5.1",
                            "arch": "ppc64",
                            "size": 13645904,
                            "path": "devel/juju-1.25.5.1-trusty-ppc64el.tgz",
                            "ftype": "tar.gz",
                            "sha256": "d72791058bf598da365a2b5257ca6c953392edf6d94247308bd671497cb7e094"
                        },
                        "1.25.5.2-trusty-ppc64": {
                            "release": "trusty",
                            "version": "1.25.5.2",
                            "arch": "ppc64",
                            "size": 13645904,
                            "path": "devel/juju-1.25.5.2-trusty-ppc64el.tgz",
                            "ftype": "tar.gz",
                            "sha256": "9ef3bbfce3234752e9f20c78954a0592b38d30764e98281845166265a26873c4"
                        }
                    }
                }
            }
        },
        "com.ubuntu.juju:14.04:ppc64el": {
            "version": "1.25.5.1",
            "arch": "ppc64el",
            "versions": {
                "20161012": {
                    "items": {
                        "1.25.5.1-trusty-ppc64el": {
                            "release": "trusty",
                            "version": "1.25.5.1",
                            "arch": "ppc64el",
                            "size": 13645904,
                            "path": "devel/juju-1.25.5.1-trusty-ppc64el.tgz",
                            "ftype": "tar.gz",
                            "sha256": "d72791058bf598da365a2b5257ca6c953392edf6d94247308bd671497cb7e094"
                        },
                        "1.25.5.2-trusty-ppc64el": {
                            "release": "trusty",
                            "version": "1.25.5.2",
                            "arch": "ppc64el",
                            "size": 13645904,
                            "path": "devel/juju-1.25.5.2-trusty-ppc64el.tgz",
                            "ftype": "tar.gz",
                            "sha256": "9ef3bbfce3234752e9f20c78954a0592b38d30764e98281845166265a26873c4"
                        }
                    }
                }
            }
        },
        "com.ubuntu.juju:16.04:amd64": {
            "version": "2.0.0",
            "arch": "amd64",
            "versions": {
                "20161012": {
                    "items": {
     ...

Read more...

Changed in juju:
status: In Progress → Incomplete
Revision history for this message
Nate Finch (natefinch) wrote :

go get github.com/axw/juju-tools
# this is a plugin to juju ^
# it uses juju, so make sure juju is building on master
juju tools build
# ^ this makes a tools .tgz in your local dir
mkdir -p mystreams/tools/devel
cp *.tgz to mystreams/tools/devel

juju metadata generate-tools -d mystreams --stream devel

#upload to s3

juju bootstrap --config=agent-metadata-url=s3urlhere

Curtis Hovey (sinzui)
description: updated
Changed in juju:
status: Incomplete → In Progress
Revision history for this message
Katherine Cox-Buday (cox-katherine-e) wrote :
Changed in juju:
assignee: Nate Finch (natefinch) → Katherine Cox-Buday (cox-katherine-e)
Changed in juju:
status: In Progress → Fix Committed
Curtis Hovey (sinzui)
Changed in juju:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.