Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

sg: cloud ephemeral fetch license key from gcp secrets manager#62479

Merged
burmudar merged 5 commits into
wb/sg/check-existing-deploymentfrom
wb/sg/cloud-eph-license-secret
May 8, 2024
Merged

sg: cloud ephemeral fetch license key from gcp secrets manager#62479
burmudar merged 5 commits into
wb/sg/check-existing-deploymentfrom
wb/sg/cloud-eph-license-secret

Conversation

@burmudar

@burmudar burmudar commented May 7, 2024

Copy link
Copy Markdown
Contributor

Fetch the license key for cloud ephemeral instances from secrets manager instead of using an env var - which was for dev purposes

Test plan

Tested locally

go run ./dev/sg cloud deploy --name license-key-test
🧪 EXPERIMENTAL COMMAND - Do you want to continue? (yes/no) y
✅ Build 273017 created. Build progress can be viewed at https://buildkite.com/sourcegraph/sourcegraph/builds/273017
Deploy instance details:
ID           : src-724be34ef2bb4dad1aa3
Name         : license-key-test
InstanceType : internal
Environment  :
Version      : wb-sg-cloud-eph-license-secret_273017_2024-05-07_5.3-e85cd7629e7e
URL          : https://license-key-test.sgdev.dev
AdminEmail   :
CreatedAt    : 1970-01-01T00:00:00Z
DeletetAt    : 1970-01-01T00:00:00Z
ExpiresAt    : 0001-01-01T00:00:00Z
Project      : src-1de168e23178f3351e03
Region       : us-central1
Status       : in progress
ActionURL    :
Error        :

@burmudar burmudar requested review from a team and filiphaftek May 7, 2024 09:53
@burmudar burmudar self-assigned this May 7, 2024
@cla-bot cla-bot Bot added the cla-signed label May 7, 2024
Comment thread dev/sg/internal/cloud/client.go Outdated
@burmudar burmudar force-pushed the wb/sg/check-existing-deployment branch from 13dd854 to 76542ab Compare May 7, 2024 14:34
@burmudar burmudar force-pushed the wb/sg/cloud-eph-license-secret branch from b4b829e to 94d0acb Compare May 7, 2024 14:34

@filiphaftek filiphaftek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

), nil
}

func getCloudEphemeralLicenseKey(ctx context.Context) (string, error) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@burmudar the proposal is to make a call to dotcom specific subscription (or msp subscription service?) and create new license for each new instance - this code is fine for today, but for the future re-using license will be blocked.
cc: @michaellzc

@burmudar burmudar merged commit 804c896 into wb/sg/check-existing-deployment May 8, 2024
@burmudar burmudar deleted the wb/sg/cloud-eph-license-secret branch May 8, 2024 09:49
burmudar added a commit that referenced this pull request May 8, 2024
* fix list instances

* handle instance not found

* use spec values

* handle cancel of build when things fail

* rebase and refactor

* do not cancel build and improve messaging

* remove cancelling of build

* fixup

* sg: cloud ephemeral fetch license key from gcp secrets manager (#62479)

* fix list instances

* create local dev const and use it with secrets

* fetch ephemeral license key from secrets

* Update dev/sg/internal/cloud/client.go
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants