Skip to content

🐛 octavia-cli: specific release job for octavia #11517

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 31 commits into from
Mar 30, 2022

Conversation

alafanechere
Copy link
Contributor

@alafanechere alafanechere commented Mar 29, 2022

What

The current release workflow does not work for Octavia because:

  • Octavia CLI builds needs Python 3.8
  • The current release workflow uses Python 3.7
  • The self-hosted runner docker version does not have the docker buildx command to build multi-arch images, which is required for Octavia.

How

1. Common bump_version.sh script

I move the version bumping logic to a separate script which is re-used by the three jobs:

  • releaseAirbyte job, called from release_version.sh
  • releaseOctavia job, called from release_version_octavia.sh
  • createPullRequest job, called from a dedicated step
    There is no harm in bumping three times in these three jobs because they all check out the same branch and only the createPullRequest job commits the changes. Other jobs require version bumping to tag the images after build.

2. Specific Octavia release job

  1. Use ubuntu-latest runner, on which docker buildx is available
  2. Install and use python 3.8 on this job
  3. Run release_version_octavia.sh which is bumping, building and publishing octavia

3. Create a final job to open the bump PR

This job runs after releaseAirbyte and releaseOctavia:

  1. Checkout Airbyte repo
  2. Bump version
  3. Create and open the bump version PR

It works 🎉

https://github.com/airbytehq/airbyte/pull/11587/files

The docker images were also successfully pushed to the DockerHub for Octavia, but I deleted the tags.
Did not run the platform build and publish yet, for safety mainly 😄

🚨User impact

The usual release process should not be impacted.

@git-phu git-phu temporarily deployed to more-secrets March 29, 2022 21:20 Inactive
@git-phu git-phu temporarily deployed to more-secrets March 29, 2022 21:37 Inactive
@git-phu
Copy link
Contributor

git-phu commented Mar 29, 2022

merged in #11518 to get the release workflow working again on master branch

@alafanechere alafanechere self-assigned this Mar 30, 2022
@alafanechere alafanechere temporarily deployed to more-secrets March 30, 2022 07:20 Inactive
@alafanechere alafanechere temporarily deployed to more-secrets March 30, 2022 07:20 Inactive
@alafanechere alafanechere temporarily deployed to more-secrets March 30, 2022 07:29 Inactive
@alafanechere alafanechere temporarily deployed to more-secrets March 30, 2022 07:49 Inactive
@alafanechere alafanechere temporarily deployed to more-secrets March 30, 2022 07:49 Inactive
@alafanechere alafanechere temporarily deployed to more-secrets March 30, 2022 07:50 Inactive
@alafanechere alafanechere temporarily deployed to more-secrets March 30, 2022 08:46 Inactive
@alafanechere alafanechere temporarily deployed to more-secrets March 30, 2022 08:46 Inactive
@alafanechere alafanechere temporarily deployed to more-secrets March 30, 2022 08:57 Inactive
@alafanechere alafanechere temporarily deployed to more-secrets March 30, 2022 08:58 Inactive
@alafanechere alafanechere temporarily deployed to more-secrets March 30, 2022 08:59 Inactive
@alafanechere alafanechere temporarily deployed to more-secrets March 30, 2022 08:59 Inactive
@alafanechere alafanechere temporarily deployed to more-secrets March 30, 2022 14:40 Inactive
@alafanechere alafanechere temporarily deployed to more-secrets March 30, 2022 14:40 Inactive
@alafanechere alafanechere temporarily deployed to more-secrets March 30, 2022 14:41 Inactive
@alafanechere alafanechere temporarily deployed to more-secrets March 30, 2022 14:42 Inactive
@alafanechere alafanechere temporarily deployed to more-secrets March 30, 2022 14:46 Inactive
@alafanechere alafanechere temporarily deployed to more-secrets March 30, 2022 14:47 Inactive
@alafanechere alafanechere temporarily deployed to more-secrets March 30, 2022 14:48 Inactive
@alafanechere alafanechere marked this pull request as draft March 30, 2022 15:02
@alafanechere alafanechere temporarily deployed to more-secrets March 30, 2022 15:25 Inactive
@alafanechere alafanechere temporarily deployed to more-secrets March 30, 2022 15:27 Inactive
@alafanechere alafanechere temporarily deployed to more-secrets March 30, 2022 15:27 Inactive
@alafanechere alafanechere temporarily deployed to more-secrets March 30, 2022 15:27 Inactive
@alafanechere alafanechere temporarily deployed to more-secrets March 30, 2022 15:40 Inactive
@alafanechere alafanechere marked this pull request as ready for review March 30, 2022 15:43
Copy link
Contributor

@supertopher supertopher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made this comments before you changed some stuff so ¯_(ツ)_/¯

but looks great overall

pip install bumpversion
bumpversion "$PART_TO_BUMP"

NEW_VERSION=$(grep -w VERSION .env | cut -d"=" -f2)
Copy link
Contributor

@supertopher supertopher Mar 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: these grep lines can get scary as the env file changes in the future

Suggested change
NEW_VERSION=$(grep -w VERSION .env | cut -d"=" -f2)
# source and . are the same command
source .env
new_version=$VERSION

by POSIX convention that is largely unfollowed ALL_CAPS variables are for use outside of the file, and lower case variables are for internal use... no one follows this though so ¯\(ツ)

my suggestion will annoy set -u as .env has alot of unset things

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can retrieve the new version from the bumpversion execution, but I wanted to use the same grep that we use for PREV_VERSION for consistency. Thanks for the suggestion! Do you think the grep regex should be more strict for safety?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

greps are fine, I've just been bitten in the past.

They are brittle to future changes and it's not usually clear when a break happens caused by changes to something like ENV variable naming

SUB_BUILD=PLATFORM ./gradlew publish
VERSION=$NEW_VERSION GIT_REVISION=$GIT_REVISION docker-compose -f docker-compose.build.yaml push
echo "Completed building and publishing..."
source ./tools/bin/bump_version.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

source seems a little confusing here, are we simply intending to execute bump version, or is there something I am missing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to make the NEW_VERSION, PREV_VERSION and GIT_REVISION variable available in this script, these are defined in ./tools/bin/bump_version.sh this why I sourced the script

Copy link
Contributor

@supertopher supertopher Mar 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screen Shot 2022-03-30 at 11 59 31 AM

you will get those variables. However you will also execute all the code. I made a screenshot example. Just like most import statements you get the variables and you execute the code

Shell in it's heart wants executables to be TINY so you can put them all together and do cool stuff. If you want half a script it's probably too large, break it up and call it from both places if it works better

@alafanechere alafanechere temporarily deployed to more-secrets March 30, 2022 16:55 Inactive
@alafanechere alafanechere temporarily deployed to more-secrets March 30, 2022 16:55 Inactive
Copy link
Contributor

@supertopher supertopher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still approving

SUB_BUILD=PLATFORM ./gradlew publish
VERSION=$NEW_VERSION GIT_REVISION=$GIT_REVISION docker-compose -f docker-compose.build.yaml push
echo "Completed building and publishing..."
source ./tools/bin/bump_version.sh
Copy link
Contributor

@supertopher supertopher Mar 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screen Shot 2022-03-30 at 11 59 31 AM

you will get those variables. However you will also execute all the code. I made a screenshot example. Just like most import statements you get the variables and you execute the code

Shell in it's heart wants executables to be TINY so you can put them all together and do cool stuff. If you want half a script it's probably too large, break it up and call it from both places if it works better

pip install bumpversion
bumpversion "$PART_TO_BUMP"

NEW_VERSION=$(grep -w VERSION .env | cut -d"=" -f2)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

greps are fine, I've just been bitten in the past.

They are brittle to future changes and it's not usually clear when a break happens caused by changes to something like ENV variable naming

@alafanechere alafanechere merged commit 2d8f66f into master Mar 30, 2022
@alafanechere alafanechere deleted the augustin/octavia-cli/fix-release branch March 30, 2022 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants