Git Product home page Git Product logo

release-tools's People

Contributors

ajkavanagh avatar andrewdmcleod avatar arif-ali avatar chrismacnaughton avatar dshcherb avatar fnordahl avatar freyes avatar gustavosr98 avatar hemanthnakkina avatar javacruft avatar lmlg avatar lourot avatar nobuto-m avatar pengale avatar ryan-beisner avatar sabaini avatar thedac avatar wolsen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

release-tools's Issues

Use the charmcraft reactive plugin instead of using overrides (also unlock charmcraft pin at 1.5/stable)

At present, the charmcraft.yaml file for reactive charms uses a set of stage/part overrides to complete the build rather than using the reactive plugin. This, due to some env variable name changes has meant that we are pinned to 1.5/stable (of charmcraft).

It would be better to use the reactive plugin and enhance that with patches so that we can unpin 1.5/stable and also have a more resilient charmcraft build going forwards. Also see: #217 comment on global/source-zaza/charmcraft-build-lock-file.yaml. @freyes

No support for reactive charms with multiple bases

Ubuntu Focal ships with Python 3.8, Ubuntu Jammy ships with Python 3.10. For any charm with anything other than the most basic wheelhouse dependencies, building the charm for Python 3.8 and expect it to run on a Python 3.10 system does not really work well.

Charmcraft and charmhub give us the tools to fix this, but the current build model prevents the use of the long awaited functionality.

At present the build target for reactive charms relies on a rename.sh script which renames all *.charm files in the top level charm directory to something the functional test gate can recognize for deployment.

This does not work well for charms that specify multiple bases, for example:

bases:
  - build-on:
      - name: ubuntu
        channel: "20.04"
        architectures:
          - amd64
    run-on:
      - name: ubuntu
        channel: "20.04"
        architectures: [amd64, s390x, ppc64el, arm64]
  - build-on:
      - name: ubuntu
        channel: "22.04"
        architectures:
          - amd64
    run-on:
      - name: ubuntu
        channel: "22.04"
        architectures: [amd64, s390x, ppc64el, arm64]

With the above configuration charmcraft will produce the following files:

my-charm_ubuntu-20.04-amd64-s390x-ppc64el-arm64.charm
my-charm_ubuntu-22.04-amd64-s390x-ppc64el-arm64.charm

We ought to remove the rename.sh script and add support in the CI to make use of the correct charm for the correct target.

Populate Charm Store vcs-revisions Field

Having repo-info is a nice way to preserve commit hash information (

echo " + Generating repo info and adding as $charm_dir/repo-info"
./generate-repo-info $charm_dir > $charm_dir/repo-info
echo "$(cat $charm_dir/repo-info | sed -e 's/^/ /')"
), however, there is another place where we could add this metadata.

When 'charm push' is invoked, it tries to obtain commit information based on vcs-specific dot files in the current directory. For classic charms this seems to happen automatically as they are not pre-processed, for reactive this is not the case as they are built into a separate directory that does not contain a dot-file.

https://git.io/vxPvs

Example:
charm show cs:keystone --all

...
extra-info:
  vcs-revisions:
  - authors:
    - email: corey.bryant@[email protected]
      name: Corey Bryant
    commit: 3a4faf4df4794b6031b49079b2c56309a3578a7f
    date: 2018-03-12T14:15:26-04:00
    message: |-
      Update SSL/https documentation
...
      Change-Id: I2e0140f909ef2c57182895f37cf191b6bc80157b
      Closes-Bug: #1754682
      (cherry picked from commit 3384ddcb87a2c7621719c8844cf5a24a25936d48)

Master release script feature request

Should have a master release script which executes subscripts for release - with built in validation, tests, git diff outputs, and requiring typed response, e.g. 'YES'

Split charms.txt into charms.txt and release-charms.txt to signal the difference between maintained charms and released charms

Essentially, this distinction is:

  • charms.txt - all the charms that need to have their requirements.txt, tox.ini, etc. maintained (along with to-be-announced upper-constraints.txt) that we want to keep in sync across all the charms.
  • release-charms.txt - the charms that get pushed to the charm store as stable releases.

i.e. charms.txt is ALL the charms. release-charms.txt is a subset of the released/SLA charms.

The tooling will need to be adjusted so that they use the correct charms.txt

charm build automation needs to use dir name from metadata if it exists

When building a layer, the resultant top level dir name for the built artifact will be:

  • the name value from metadata.yaml, if it exists
  • or, the local directory (repo or checkout dir) name if metadata.yaml doesn't exist or doesn't declare a name.

The scripts and wrappers which do charm builds need to understand that and act accordingly.

Positional args are not passed to fetch-charms target

I may be using the wrong version of Tox, but when I tried to run tox with the fetch-charms target Tox the positional args were not passed to fetch-charms.py. The positional args were consumed by Tox. This command, for example, returned the help from Tox instead of fetch-charms.py

tox -e fetch-charms -h

I tried a few variations on running Tox and fetch-charms, like adding the -- after fetch-charms, since that appears to be what Tox expects. This did invoke fetch-charms, but fetch-charms was ignoring the input as in this example:

tox -e fetch-charms -- --section openstack
fetch-charms: commands[0]> python3 /home/jadon/work-projects/release-tools/fetch-charms.py -- --section openstack
usage: fetch-charms.py [-h] [--log {DEBUG,INFO,WARN,ERROR,CRITICAL}] --section SECTION [--charm CHARM]
                       [--ignore-charm IGNORE_CHARM] [--worktree WORKTREE] [--worktree-dir WORKTREE_DIR] [--branch BRANCH]
                       [--dir DIRECTORY] [--replace] [--ignore-failure] [--checkout-topic CHECKOUT_TOPIC]
                       [--skip-if-present] [--reuse]
fetch-charms.py: error: the following arguments are required: --section/-s
fetch-charms: exit 2 (0.05 seconds) /home/jadon/work-projects/release-tools> python3 /home/jadon/work-projects/release-tools/fetch-charms.py -- --section openstack pid=231871
  fetch-charms: FAIL code 2 (0.07=setup[0.02]+cmd[0.05] seconds)
  evaluation failed :( (0.10 seconds)

If I did the command without -- I got the following:

tox -e fetch-charms --section openstack
usage: tox [-h] [--colored {yes,no}] [-v | -q] [--exit-and-dump-after seconds] [-c file] [--workdir dir] [--root dir] [--runner {virtualenv}] [--version] [--no-provision [REQ_JSON]] [--no-recreate-provision] [-r] [-x OVERRIDE]
           {run,r,run-parallel,p,depends,de,list,l,devenv,d,config,c,quickstart,q,exec,e,legacy,le} ...
tox: error: unrecognized arguments: --section openstack
hint: if you tried to pass arguments to a command use -- to separate them from tox ones

I was able to run Tox with the fetch-charms target by removing the -- from the declaration in tox.ini for the target testenv:fetch-charms. This declaration made fetch-charms work for me:

[testenv:fetch-charms]
basepython = python3
deps = -r{toxinidir}/requirements.txt
commands = python3 {toxinidir}/fetch-charms.py {posargs}

I am using Tox 4, but I got this same behavior on Tox 3. Am I missing something or do I need to update tox.ini to remove the -- before {posargs}?

mysql-innodb-cluster uses a resource with a .snap extension -- charm-pusher tool can't handle that at present

The mysql-innodb-cluster charm now specifies a resource with a .snap extension. The resource tools build a resource with a .zip extension. Thus the charm pusher won't push the charm with the following error:

ERROR cannot get resource: cs:~openstack-charmers-next/mysql-innodb-cluster-20 has no "mysql-shell" resource
+ charm attach 'cs:~openstack-charmers-next/mysql-innodb-cluster-20' mysql-shell=resource.zip

Need to update the tool to create the resource with the same extension, and that means adding the extension to the resources.txt file.

Use parsed details from .gitreview for check-repo-links script

The 'linting' script makakes assumptions on the URL for the upstream project, but we can parse it from the .gitreview. Enhance it to make it more resilient. From #217:

$ REPO=$(grep "^project=.*" .gitreview | awk -F'=' '{print $2}')
$ echo $REPO
openstack/charm-octavia.git
$ echo ${REPO%.*}
openstack/charm-octavia

update-stable-charms/stable-branch-updates are not always pinning charms.openstack

When releasing 20.08, we noticed two issues in

./update-stable-charms 20.08  # running stable-branch-updates unter the hood

especially at https://github.com/openstack-charmers/release-tools/blob/master/stable-branch-updates#L65

  1. this block won't pin charms.openstack in src/wheelhouse.txt and test-requirements.txt if src/layer.yaml doesn't contain layer:openstack. For ovn-dedicated-chassis this led to patchset 1. This is wrong because this charm pulls layer:openstack transitively through layer:ovn. So in fact this script should have done the pinning unconditionally.
  2. also ideally this script should have gone the extra mile and created an src/wheelhouse.txt to also pin what comes from layers transitively.

A correct script would have created patchset 2 directly.

No osci.yaml management

osci.yaml has been updated when the charmhub migration happened some time ago.
https://github.com/openstack-charmers/release-tools/search?q=charm-unit-jobs-py38

However, since then release-tools hasn't have a way to keep it up-to-date. For example, the following update deleted the definition of testenv:py38 but oscsi.yaml in each charm still runs charm-unit-jobs-py38.

https://github.com/openstack-charmers/release-tools/pull/234/files#diff-787e12a93f77560a0ba72920b7c164e836e6d279b40e95cae43d2e2969b04fdd

If tox.ini is supposed to be managed centrally, osci.yaml should be managed in the same manner.

`tox -e ...` on charms fails with ResolutionImpossible

Since yesterday (2021-07-20) the pip resolver seems to behave differently and fails on following conflicts:

The conflict is caused by:
    The user requested zaza 0.0.2.dev1 (from git+https://github.com/openstack-charmers/zaza.git#egg=zaza;python_version>='3.0')
    zaza-openstack 0.0.1.dev1 depends on zaza 0.0.2.dev1 (from git+https://github.com/openstack-charmers/zaza.git#egg=zaza)

The conflict is caused by:
    tempest 27.0.1.dev70 depends on jsonschema>=3.2.0
    charm-tools 2.8.3 depends on jsonschema<=2.5.1
    tempest 27.0.1.dev70 depends on jsonschema>=3.2.0
    charm-tools 2.8.2 depends on jsonschema<=2.5.1
    tempest 27.0.1.dev70 depends on jsonschema>=3.2.0
    charm-tools 2.8.1 depends on jsonschema<=2.5.1
    tempest 27.0.1.dev70 depends on jsonschema>=3.2.0
    charm-tools 2.7.8 depends on jsonschema<=2.5.1
    tempest 27.0.1.dev70 depends on jsonschema>=3.2.0
    charm-tools 2.7.7 depends on jsonschema<=2.5.1
    tempest 27.0.1.dev70 depends on jsonschema>=3.2.0
    charm-tools 2.7.6 depends on jsonschema<=2.5.1
    tempest 27.0.1.dev70 depends on jsonschema>=3.2.0
    charm-tools 2.7.5 depends on jsonschema<=2.5.1
    tempest 27.0.1.dev70 depends on jsonschema>=3.2.0
    charm-tools 2.7.3 depends on jsonschema<=2.5.1
    tempest 27.0.1.dev70 depends on jsonschema>=3.2.0
    charm-tools 2.7.2 depends on jsonschema<=2.5.1
    tempest 27.0.1.dev70 depends on jsonschema>=3.2.0
    charm-tools 2.7.0 depends on jsonschema<=2.5.1
    tempest 27.0.1.dev70 depends on jsonschema>=3.2.0
    charm-tools 2.6.1 depends on jsonschema<=2.5.1
    tempest 27.0.1.dev70 depends on jsonschema>=3.2.0
    charm-tools 2.6.0 depends on jsonschema<=2.5.1
    zaza 0.0.2.dev1 depends on PyYAML
    zaza-openstack 0.0.1.dev1 depends on PyYAML
    tempest 27.0.1.dev70 depends on PyYAML>=3.12
    charm-tools 2.5.1 depends on pyyaml==3.11
    zaza 0.0.2.dev1 depends on PyYAML
    zaza-openstack 0.0.1.dev1 depends on PyYAML
    tempest 27.0.1.dev70 depends on PyYAML>=3.12
    charm-tools 2.5.0 depends on pyyaml==3.11
    zaza 0.0.2.dev1 depends on PyYAML
    zaza-openstack 0.0.1.dev1 depends on PyYAML
    tempest 27.0.1.dev70 depends on PyYAML>=3.12
    charm-tools 2.4.5 depends on pyyaml==3.11
    zaza 0.0.2.dev1 depends on PyYAML
    zaza-openstack 0.0.1.dev1 depends on PyYAML
    tempest 27.0.1.dev70 depends on PyYAML>=3.12
    charm-tools 2.4.4 depends on pyyaml==3.11

The first conflict is easy to solve by removing ;python_version>='3.0' in test-requirements.txt

The second conflict is legit: we want to install the latest tempest (we need it as a binary), but at the same time we want to install charm-tools, which pins older libraries to keep py3.5 support. The solution: we don't actually need to install charm-tools and tempest in the same venvs. charm-tools is needed for pep8 whereas tempest is needed for functional tests (Zaza runs). This has been solved properly in this repo: https://github.com/openstack-charmers/charmed-openstack-tester/blob/master/tox.ini#L29

This is hitting us in all classic charms. So far seen on:

I'm working on a fix.

Pinning of pip and setuptools on tox 2.5 (bionic) doesn't work

osci runs the CI jobs on Bionic, this version of tox (2.5) will automatically upgrade the packages at virtualenv creation and any pinning won't have effect.

The recently version of setuptools (58.0) dropped the support for use_2to3=true which is needed to install blessings (an indirect dependency of charm-tools).

More details on the beahvior of tox and virtualenv creation can be found at tox-dev/tox#448

An attempt to workaround the issue using a wrapper around pip based on what was done zaza can be found at https://review.opendev.org/c/openstack/charm-ceph-fs/+/810022

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.