Skip to content

Undeploy an API without having to delete the Host #1532

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Nanashi-lab
Copy link
Contributor

/closes #1494

  1. Opened a new endpoint Delete /v1/api/deployments/{site}/{id}/{version} which undeploys a single api/version from the site
  2. Make sure it properly deals with, Api not found or Site not found
  3. Updated undeploy to be able to remove component constrain

@@ -182,4 +183,102 @@ impl ApiDeploymentApi {

Ok(Json("API deployment deleted".to_string()))
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the endpoint. /:site/:id/:version

@@ -457,10 +461,32 @@ impl<Namespace: GolemNamespace, AuthCtx: GolemAuthCtx> ApiDeploymentService<Auth
}

if !remove_deployment_records.is_empty() {
// 3. Get the specific API definitions being undeployed
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removing component constraints during undeploy. There is no need for test as service_test already uses undeploy function

@Nanashi-lab
Copy link
Contributor Author

Nanashi-lab commented Apr 16, 2025

I side stepped the Issue #1529 by adding those parts manually back in. Did Cargo Make fix to check if everything is working.

@mschuwalow
Copy link
Contributor

Please also add a test for the new endpoint to https://github.com/golemcloud/golem/tree/main/integration-tests/tests/api

@Nanashi-lab
Copy link
Contributor Author

Nanashi-lab commented Apr 16, 2025

@mschuwalow All local deployment test always fail for me, and this has been the case for a while, since 2-3 week old HEAD.

Failed tests:
 - api::api_security::get_api_security_scheme (called `Result::unwrap()` on an `Err` value: not available on GRPC API: create_api_security_scheme)
 - api::api_security::create_api_security_scheme (called `Result::unwrap()` on an `Err` value: not available on GRPC API: create_api_security_scheme)
 - api::api_deployment::create_multiple_api_deployments_and_update_component_1 (called `Result::unwrap()` on an `Err` value: not available on GRPC API: create_api_deployment)
 - api::api_deployment::create_multiple_api_deployments_and_update_component_2 (called `Result::unwrap()` on an `Err` value: not available on GRPC API: create_api_deployment)
 - api::api_deployment::get_all_api_deployments (called `Result::unwrap()` on an `Err` value: not available on GRPC API: create_api_deployment)
 - api::invocation_context::invocation_context_test (called `Result::unwrap()` on an `Err` value: not available on GRPC API: create_api_deployment)[2m2025-04-16T15:52:29.295200Z[0m �[32m INFO[0m �[2mgolem_test_framework::components�[0m�[2m:[0m [componentsvc][2m2025-04-16T15:52:29.295101Z[0m �[34mDEBUG�[0m �[2mtonic::transport::channel::service::connection�[0m�[2m:[0m connection task error: hyper::Error(Io, Custom { kind: BrokenPipe, error: "connection closed because of a broken pipe" })
 - api::api_deployment::create_api_deployment_and_update_component (called `Result::unwrap()` on an `Err` value: not available on GRPC API: create_api_deployment)
 - api::api_deployment::create_and_get_api_deployment (called `Result::unwrap()` on an `Err` value: not available on GRPC API: create_api_deployment)

@Nanashi-lab Nanashi-lab marked this pull request as draft April 17, 2025 06:29
@vigoo
Copy link
Contributor

vigoo commented Apr 17, 2025

Those tests need to be run in http mode which is currently controlled by an environment variable (this is not ideal but has its reasons). You can see the details of it in the makefile

@@ -1247,6 +1247,18 @@ pub trait WorkerService: WorkerServiceInternal {
}

async fn kill(&self);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added undeploy to test-framework

@Nanashi-lab Nanashi-lab marked this pull request as ready for review April 18, 2025 10:16
@Nanashi-lab
Copy link
Contributor Author

@mschuwalow This PR is ready for review, I am certain worker-tests-group4 timing out after 40 mins, is unrelated to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Undeploy an API without having to delete the Host
3 participants