-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[server] Separate instance creation from instance starting (again) #18642
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
Conversation
15ab10f
to
bd3a5a7
Compare
f4fa9fd
to
349ec71
Compare
349ec71
to
c7bc851
Compare
@@ -101,7 +101,7 @@ export class DBWorkspaceInstance implements WorkspaceInstance { | |||
type: "simple-json", | |||
nullable: true, | |||
}) | |||
configuration?: WorkspaceInstanceConfiguration; | |||
configuration: WorkspaceInstanceConfiguration; |
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 checked the DB: We have 0 instances where this field is NULL
or ""
.
// Beware: this field was added retroactively and not all instances have valid | ||
// values here. | ||
configuration?: WorkspaceInstanceConfiguration; | ||
configuration: WorkspaceInstanceConfiguration; |
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 checked the DB: We have 0 instances where this field is NULL or "".
@@ -129,7 +130,6 @@ import { SYSTEM_USER } from "../authorization/authorizer"; | |||
import { ResolvedEnvVars } from "../user/env-var-service"; | |||
|
|||
export interface StartWorkspaceOptions extends GitpodServer.StartWorkspaceOptions { |
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.
rethrow was never anywhere anymore.
@@ -308,6 +308,7 @@ export class WorkspaceStarter { | |||
project, | |||
options.excludeFeatureFlags || [], | |||
ideConfig, | |||
options.region, |
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.
With this change, after instance creation, there is no need for any further lookup: The instance shape contains everything that is needed to start a workspace.
Only exception that is up for discussion: envVars. Ideally we should store those as well, but I refrained because we might store unencrypted passwords or similar.
Open for comments and ideas here!
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.
Is it because JSON stored unencrypted? i.e. how is it different to value in env var tables?
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.e. how is it different to value in env var tables?
There we use an encrypting transformer (source).
): Promise<{ initializer: WorkspaceInitializer; disposable: Disposable }> { | ||
let result = new WorkspaceInitializer(); | ||
const disp = new DisposableCollection(); | ||
|
||
if (lastValidWorkspaceInstanceId != "") { | ||
if (fromBackup) { |
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.
This check was the only reason we piped lastValidWorkspaceInstanceId: string
through 4 layers... 🙈
@akosyakov Would be great to get your feedback for the changes around ideConfig. I assumed that |
@geropl You can check here:
|
/gh run recreate-vm=true Comment triggered a workflow runStarted workflow run: 6069970179
|
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 smoke tested that workspace with custom settings still can be started. Code changes also look reasonable.
@geropl Prebuilds are another path right? We will need to take care about them separately from |
Prebuilds are using this path as well (source). |
/unhold |
Description
In preparation of making sure we don't break workspace starts during rollouts, this PR does some cleanup in WorkspaceStarter. Most importantly, we ensure that after a
WorkspaceInstance
is stored in the DB, we can start a workspace from it. 👍 (also, makes the code cleaner).Short summary to make the changes easier to digest:
buildImageAndStartWorkspace
to "mark" that separation, but also for usage in upcoming PRsoptions.rethrow
: not used anymorelastValidWorkspaceInstanceId
through multiple layers for a simple check, condense it intofromBackup
right awayideConfig
that we need during workspace start intoinstance.configuration.ideSetup
Summary generated by Copilot
🤖 Generated by Copilot at f4fa9fd
This pull request adds a new interface for IDE setup, refactors the workspace-starter and ide-service modules, and makes the configuration field mandatory for workspace instances.
Related Issue(s)
Related to EXP-549
Depends on: #18641
How to test
Documentation
Preview status
Gitpod was successfully deployed to your preview environment.
Build Options
Build
Run the build with werft instead of GHA
Run Leeway with
--dont-test
Publish
Installer
Add desired feature flags to the end of the line above, space separated
Preview Environment / Integration Tests
If enabled this will build
install/preview
If enabled this will create the environment on GCE infra
Valid options are
all
,workspace
,webapp
,ide
,jetbrains
,vscode
,ssh
. If enabled,with-preview
andwith-large-vm
will be enabled./hold