-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
publish spec as part of connector publish script #5994
Conversation
@@ -90,15 +90,19 @@ public BucketSpecCacheSchedulerClient(final SynchronousSchedulerClient client, f | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all changes in this file are just adding debug log statements.
tools/integrations/manage.sh
Outdated
# publish spec to cache. do so, by running get spec locally and then pushing it to gcs. | ||
local tmp_spec_file; tmp_spec_file=$(mktemp) | ||
docker run --rm "$versioned_image" spec | jq .spec > "$tmp_spec_file" | ||
gcloud auth activate-service-account --key-file /Users/charles/Downloads/prod-ab-cloud-proj-bdb658ebbe5a.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so this line is obviously wrong (since it mentions the FS on my local machine). As far as I can tell this script gets called from 2 places: 1. from people's local machines 2. from GH actions. I think my inclination is to add another argument for cmd_publish
where the user has to publish the path to the service account key. @sherifnada does this feel like a reasonable way of going about it? It's a credential so it has to add some developer friction, but I'm trying to keep it as light as possible.
I guess it should be designed so that if someone doesn't pass the cred but their gsutil
is already authed into a user that can access the bucket then it should still work as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems reasonable to me to limit publishing new connector versions to only Github
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kk. well it's possible in both places now :D
tools/integrations/manage.sh
Outdated
# publish spec to cache. do so, by running get spec locally and then pushing it to gcs. | ||
local tmp_spec_file; tmp_spec_file=$(mktemp) | ||
docker run --rm "$versioned_image" spec | jq .spec > "$tmp_spec_file" | ||
gcloud auth activate-service-account --key-file /Users/charles/Downloads/prod-ab-cloud-proj-bdb658ebbe5a.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should inject this key in CI and pull from an env variable
There generally shouldn't be a strong need to publish from a local machine as you can already skip tests from CI is needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kk. made it so it was possible to so locally if needed. happens by default in the publish command on GH
tools/integrations/manage.sh
Outdated
|
||
# publish spec to cache. do so, by running get spec locally and then pushing it to gcs. | ||
local tmp_spec_file; tmp_spec_file=$(mktemp) | ||
docker run --rm "$versioned_image" spec | jq .spec > "$tmp_spec_file" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sherifnada this will break if spec returns anything but a single airbyte message of type spec. do you have any sense of how bad of an assumption that is. i guess we can protect against this by getting a little fancier with jq.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recommend filtering to the right spec message. It shouldn't be that much harder to filter to only spec messages right? (and there should definitely only be one of those)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool. added new jq logic. it handles:
- filtering non valid json
- picking the first spec if multiple are returned
- failing if no specs are returned
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good.
1 small comment.
/publish connector=connectors/source-pokeapi
|
/publish connector=connectors/source-pokeapi
|
/publish connector=connectors/source-pokeapi
|
/publish connector=connectors/source-pokeapi
|
/publish connector=connectors/source-pokeapi
|
This reverts commit 940888c.
@@ -69,6 +89,34 @@ cmd_publish() { | |||
echo "Publishing new version ($versioned_image)" | |||
docker push "$versioned_image" | |||
docker push "$latest_image" | |||
|
|||
if [[ "true" == "${publish_spec_to_cache}" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should there be extra conditions here to exclude normalization docker images when publishing? see #6052 (comment)
Closes #5266
What
It helps to add screenshots if it affects the frontend.
How
manage.sh
script add logic to push to our GCS bucket cache.Recommended reading order
tools/integrations/manage.sh
Pre-merge Checklist
Open Question