Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .semaphore/semaphore-scheduled-builds.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .semaphore/semaphore.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .semaphore/semaphore.yml.d/blocks/40-openstack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
- export NC_PLUGIN_REPO=$(dirname $(pwd))
- export NC_PLUGIN_REF=$(git rev-parse --abbrev-ref HEAD)
- sudo git config --system --add safe.directory ${NC_PLUGIN_REPO}/.git
- TEMPEST=true DEVSTACK_BRANCH=unmaintained/yoga ./devstack/bootstrap.sh
- TEMPEST=true OPENSTACK_RELEASE=yoga ./devstack/bootstrap.sh
epilogue:
on_fail:
commands:
Expand Down Expand Up @@ -77,7 +77,7 @@
- export NC_PLUGIN_REPO=$(dirname $(pwd))
- export NC_PLUGIN_REF=$(git rev-parse --abbrev-ref HEAD)
- sudo git config --system --add safe.directory ${NC_PLUGIN_REPO}/.git
- TEMPEST=true DEVSTACK_BRANCH=unmaintained/2024.1 ./devstack/bootstrap.sh
- TEMPEST=true OPENSTACK_RELEASE=caracal ./devstack/bootstrap.sh
epilogue:
always:
commands:
Expand Down
2 changes: 1 addition & 1 deletion networking-calico/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ upper-constraints-yoga.txt:
curl -fsSL --retry 5 https://releases.openstack.org/constraints/upper/yoga -o $@

upper-constraints-caracal.txt:
curl -fsSL --retry 5 https://raw.githubusercontent.com/openstack/requirements/refs/heads/unmaintained/2024.1/upper-constraints.txt -o $@
curl -fsSL --retry 5 https://raw.githubusercontent.com/openstack/requirements/refs/heads/`./infer-openstack-branch.sh caracal requirements`/upper-constraints.txt -o $@

fmtpy: build-test-container
$(RUN_TEST_CONTAINER) tox -e black
Expand Down
30 changes: 13 additions & 17 deletions networking-calico/devstack/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,16 @@ sudo pip list || true
# For a single node Calico/DevStack cluster, the environment should leave
# SERVICE_HOST unset.
#
# OPENSTACK_RELEASE
#
# The OpenStack release to test with, e.g. "yoga" or "caracal". This is
# used to calculate the value of DEVSTACK_BRANCH when not already set.
#
# DEVSTACK_BRANCH
#
# By default this script uses the master branch of devstack. To use a
# different branch, set the DEVSTACK_BRANCH environment variable before
# running this script; for example:
# By default this script uses the appropriate DevStack branch for
# OPENSTACK_RELEASE. To use a different branch, set the DEVSTACK_BRANCH
# environment variable before running this script; for example:
#
# export DEVSTACK_BRANCH=stable/liberty
#
Expand All @@ -80,27 +85,18 @@ sudo pip list || true
#
# ------------------------------------------------------------------------------

# Handle branch name transition from "stable/yoga" to "unmaintained/yoga". The DevStack repo
# internally still uses "stable/yoga" for all its defaults even though all the actual branch names
# have changed to "unmaintained/yoga".
if [ "${DEVSTACK_BRANCH}" = unmaintained/yoga ]; then
export CINDER_BRANCH=unmaintained/yoga
export GLANCE_BRANCH=unmaintained/yoga
export KEYSTONE_BRANCH=unmaintained/yoga
export NEUTRON_BRANCH=unmaintained/yoga
export NOVA_BRANCH=unmaintained/yoga
export PLACEMENT_BRANCH=unmaintained/yoga
export REQUIREMENTS_BRANCH=unmaintained/yoga
if [ -z "${DEVSTACK_BRANCH}" ]; then
DEVSTACK_BRANCH=`./infer-openstack-branch.sh ${OPENSTACK_RELEASE} devstack`
fi

# Set correct constraints for Tempest to use. We need to do this because we're pinning to a
# different version of Tempest than the version that DevStack would naturally use.
case "${DEVSTACK_BRANCH}" in
unmaintained/yoga )
*/yoga )
export UPPER_CONSTRAINTS_FILE=https://releases.openstack.org/constraints/upper/yoga
;;
unmaintained/2024.1 ) # Caracal
export UPPER_CONSTRAINTS_FILE=https://raw.githubusercontent.com/openstack/requirements/refs/heads/unmaintained/2024.1/upper-constraints.txt
* )
export UPPER_CONSTRAINTS_FILE=https://raw.githubusercontent.com/openstack/requirements/refs/heads/${DEVSTACK_BRANCH}/upper-constraints.txt
;;
esac

Expand Down
35 changes: 35 additions & 0 deletions networking-calico/infer-openstack-branch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

# Infer the current branch name for the OpenStack release $1 in repo name $2.
if [ $# -ne 2 ]; then
echo "Usage: $0 <openstack release> <repo name>"
echo
echo "For example: $0 caracal devstack"
exit 1
fi
RELEASE=$1
REPO=$2

# Translate modern OpenStack release names to their YEAR.NUMBER form.
FORMAL_RELEASE=${RELEASE}
case "${RELEASE}" in
caracal )
FORMAL_RELEASE=2024.1
;;
gazpacho )
FORMAL_RELEASE=2026.1
;;
esac

if [ `git ls-remote -h https://github.com/openstack/${REPO} refs/heads/stable/${FORMAL_RELEASE} | wc -l` = 1 ]; then
echo stable/${FORMAL_RELEASE}
exit 0
fi

if [ `git ls-remote -h https://github.com/openstack/${REPO} refs/heads/unmaintained/${FORMAL_RELEASE} | wc -l` = 1 ]; then
echo unmaintained/${FORMAL_RELEASE}
exit 0
fi

echo "ERROR: can't identify branch for OpenStack ${RELEASE} in ${REPO}"
exit 1