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

Workspace Management Rework #1729

Merged
merged 76 commits into from
Jan 21, 2025
Merged

Workspace Management Rework #1729

merged 76 commits into from
Jan 21, 2025

Conversation

Tpuljak
Copy link
Member

@Tpuljak Tpuljak commented Jan 17, 2025

Workspace Management Rework

Description

Projects have been renamed to Workspaces.
Workspaces have been renamed to Targets
Targets have been renamed to Target Configs.

Project configs have also been renamed to Templates; e.g. daytona template list

Workspaces have been "detached" from targets - they can now be created inside and deleted from targets removing the
need to provision a new target whenever creating a workspace.

Resource state management issues have been resolved - new resource states regarding starting/stopping/deleting workspaces or e.g. running builds are introduced.

Issues for a "remote provisioner" and "remote image builder" have been solved by introducing Runners - a standalone mode/component in charge of asynchronously fetching and running workspace/target/build creation and other processes.
This allows users to e.g. create a remote VM, install Daytona and connect it to the existing Daytona Server to create workspaces. Local provisioning/building is managed by the Local Runner which can be disabled through the Daytona
Server configuration.

Runners are responsible for managing providers and each one has its own set of providers. When creating target configs, users are prompted to choose a runner to link it to.

Introduced Workspace Labels allowing workspaces to be grouped and filtered by user-defined text fields.

It is now possible to SSH into targets and use the Daytona binary inside of them to view info and read logs.

Container registries are no longer managed through a CLI command and are now managed by environment variables instead

Purging Daytona now delegates removal of Resources (workspaces, targets, builds) to the user because they are now treated independently.

Telemetry has been updated/improved to match the changes.

CLI commands arguments and aliases have been made to be more consistent.

README.md has been redone to adhere to the changes and trimmed of a large amount of the content.

  • This change requires a documentation update
  • I have made corresponding changes to the documentation

** Documentation updates are made in this PR (daytonaio/docs#207)

Related Issue(s)

Closes #1710
Closes #1696
Closes #1517
Closes #752
Closes #747
Closes #703
Closes #678
Closes #595
Closes #362
Closes #159

Breaking changes

Major breaking changes in the CLI, Server, Providers and their interfaces. Purging Daytona using 'daytona purge' will be necessary before reinstalling. Alternatively, you may stop the server and then delete the entire config folder.

Notes

To test this PR, it's recommended that users start the server for the first time with the DEFAULT_REGISTRY_URL=https://download.daytona.io/daytona-providers-pre-release environment variable set.
This will ensure that correct provider version are downloaded.

As of now, supported providers are:

  • Docker
  • AWS
  • DigitalOcean

Installing other providers might cause issues with the server.

@Tpuljak Tpuljak requested review from a team as code owners January 17, 2025 15:34
* refactor: rename Target to Target Config

BREAKING CHANGE:
- target commands are now target-config commands
- Target property is now TargetConfig property in all Workspace models
- /target endpoint is now /target-config endpoint

Signed-off-by: Toma Puljak <[email protected]>
BREAKING CHANGE:
- renamed all occurrences of Workspace to Target
- renamed all relevant functions, methods and commands
- changed the provider interface to use Target instead of Workspace

Signed-off-by: Toma Puljak <[email protected]>
lbrecic
lbrecic previously approved these changes Jan 21, 2025
Copy link
Contributor

@lbrecic lbrecic left a comment

Choose a reason for hiding this comment

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

LGTM 👍 🚀

idagelic and others added 25 commits January 21, 2025 10:57
BREAKING CHANGE:
    - renamed all occurrences of project to workspace
    - renamed all relevant functions, methods and commands
    - changed the provider interface to use Workspace instead of Project

Signed-off-by: Ivan Dagelic <[email protected]>
- replace target id with name in list cmd (#1307)
- target logger and create command output update (#1306)
- Workspaces are now their own model with their own API and Service

BREAKING CHANGES:
- provider interface changes
- target model changes
- SSH hostname changes - target is not part of the hostname

Signed-off-by: Toma Puljak <[email protected]>
Signed-off-by: Luka Brecic <[email protected]>
- targets no longer have a relation to a target configs
- workspaces can be managed on already created targets
- targets can not be removed if a workspace is attached to it

BREAKING CHANGE:
- target config - target relation

Signed-off-by: Ivan Dagelic <[email protected]>
- async state management using jobs and job runners
- soft deletion for workspaces/targets
- workspace metadata and target metadata table to separately track uptime updates for each resource

BREAKING CHANGES:
- multiple database table structure updates

Signed-off-by: Ivan Dagelic <[email protected]>
- all service and store methods expect a context
- the context is used to pass a transaction between stores
- job concurrency issues fully resolved

Signed-off-by: Toma Puljak <[email protected]>
Signed-off-by: Toma Puljak <[email protected]>
Tpuljak and others added 20 commits January 21, 2025 11:13
Signed-off-by: Ivan Dagelic <[email protected]>
- Users can add labels to workspaces when creating them or update them through the API
- Users can query for workspaces that match labels provided in query params

Signed-off-by: Toma Puljak <[email protected]>
Signed-off-by: Ivan Dagelic <[email protected]>
Signed-off-by: Ivan Dagelic <[email protected]>
Signed-off-by: Ivan Dagelic <[email protected]>
Signed-off-by: Ivan Dagelic <[email protected]>
Signed-off-by: Ivan Dagelic <[email protected]>
lbrecic
lbrecic previously approved these changes Jan 21, 2025
Copy link
Contributor

@lbrecic lbrecic left a comment

Choose a reason for hiding this comment

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

LGTM 👍 🚀

Signed-off-by: Toma Puljak <[email protected]>
Signed-off-by: Ivan Dagelic <[email protected]>
Copy link
Contributor

@lbrecic lbrecic left a comment

Choose a reason for hiding this comment

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

LGTM once again! 👍 🚀
Nicely done! 🔥

@Tpuljak Tpuljak merged commit 2f0db3c into main Jan 21, 2025
12 checks passed
@Tpuljak Tpuljak deleted the target-workspace-refactor branch January 21, 2025 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment