Skip to content
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

ci(app): deploy app artifacts to build number prefixed folder #13970

Draft
wants to merge 2 commits into
base: edge
Choose a base branch
from

Conversation

shlokamin
Copy link
Member

Overview

DO NOT MERGE UNTIL AFTER 7.1 IS RELEASED

This PR deploys app builds to a folder prefixed by build number. This is so we don't overwrite historical build artifacts so we can route electron updater to previous non revoked builds if the latest build has been revoked.

Related to https://github.com/Opentrons/robot-stack-infra/pull/34

Changelog

  • Deploy app artifacts to build number prefixed folder

Review requests

This one is hard to test without pushing actual internal release/release tags, we'll have to battle test this during the next alpha process after 7.1 gets released to production

Risk assessment

High, this touches critical release artifact infrastructure

@shlokamin shlokamin added the DO NOT MERGE Indicates a PR should not be merged, even if there's a shiny green merge button available label Nov 13, 2023
echo "folder=${{env._APP_DEPLOY_BUCKET_OT3}}" >> $GITHUB_OUTPUT
echo "folder=${{env._APP_DEPLOY_FOLDER_OT3}}" >> $GITHUB_OUTPUT
Copy link
Member Author

@shlokamin shlokamin Nov 13, 2023

Choose a reason for hiding this comment

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

i think this was just straight up wrong before and we never noticed because we were using top level env vars to deploy below.

Copy link
Member

Choose a reason for hiding this comment

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

yup #13966

Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

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

inline notes

@@ -290,7 +290,7 @@ jobs:
HOST_PYTHON: python
OPENTRONS_PROJECT: ${{ steps.project.outputs.project }}
OT_APP_DEPLOY_BUCKET: ${{ steps.project.outputs.bucket }}
OT_APP_DEPLOY_FOLDER: ${{ steps.project.outputs.folder }}
OT_APP_DEPLOY_FOLDER: ${{ steps.project.outputs.folder }}/${{OT_BUILD}}
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this is right because there's two places that need the OT_BUILD to not be included:

  1. Below (see comment) we upload releases.json to OT_APP_DEPLOY_FOLDER, and releases.json needs to be in /app not /app/$OT_BUILD
  2. this environment variable configures the electron-updater's target URL, and we want electron-updater to continue to look at /app/

Copy link
Member Author

Choose a reason for hiding this comment

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

oopsy didnt realize that env var is used by the app shell and app shell odd, thanks!

@@ -343,11 +343,13 @@ jobs:
aws configure set source_profile identity --profile deploy
shell: bash
- name: 'deploy release builds to s3'
if: contains(fromJSON(needs.determine-build-type.outputs.variants), 'release')
Copy link
Member

Choose a reason for hiding this comment

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

this definitely is wrong - internal-release contains release so it will fire on both. I think this won't do anything though because the code above creates one subdir for release artifacts and one subdir for internal-release artifacts and sorts them, so to_upload_release/ would be empty if this was an internal release (this is also why these steps were not if-gated before)

Copy link
Member Author

Choose a reason for hiding this comment

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

lol yes that if statement is useless, good catch. i still think its worth correcting the if statement and including it though, even though one of the subdirs would be empty i think it makes things easier to follow

@@ -453,13 +455,13 @@ jobs:
- name: 'update internal-releases releases.json'
if: needs.determine-build-type.outputs.type == 'release' && contains(fromJSON(needs.determine-build-type.outputs.variants), 'internal-release')
run: |
aws --profile=deploy s3 cp s3:https://${{ env._APP_DEPLOY_BUCKET_OT3 }}/${{ env._APP_DEPLOY_FOLDER_OT3 }}/releases.json ./to_upload_internal-release/releases.json
aws --profile=deploy s3 cp s3:https://${{ env._APP_DEPLOY_BUCKET_OT3 }}/${{ env.OT_APP_DEPLOY_FOLDER }}/releases.json ./to_upload_internal-release/releases.json
Copy link
Member

Choose a reason for hiding this comment

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

releases.json still wants to stay in builds.opentrons.com/app/, not /app/$BUILDNUMBER - this is one of the reasons I don't think we can just append the build id to the environment variable above

Copy link
Member Author

Choose a reason for hiding this comment

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

beep boop beep yes releases.json needs to be at the top level. ill remove the build number from the env variable and only use it for app artifact deploys

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DO NOT MERGE Indicates a PR should not be merged, even if there's a shiny green merge button available
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants