Derive the webapp host container id from stable data
All checks were successful
Lint Checks / Run linter (pull_request) Successful in 37s
Webapp Test / Run webapp test suite (pull_request) Successful in 4m44s
Smoke Test / Run basic test suite (pull_request) Successful in 4m43s
Deploy Test / Run deploy test suite (pull_request) Successful in 5m31s
K8s Deploy Test / Run deploy test suite on kind/k8s (pull_request) Successful in 8m34s
All checks were successful
Lint Checks / Run linter (pull_request) Successful in 37s
Webapp Test / Run webapp test suite (pull_request) Successful in 4m44s
Smoke Test / Run basic test suite (pull_request) Successful in 4m43s
Deploy Test / Run deploy test suite (pull_request) Successful in 5m31s
K8s Deploy Test / Run deploy test suite on kind/k8s (pull_request) Successful in 8m34s
This commit is contained in:
parent
ca5fffaed5
commit
8430c83e89
@ -99,16 +99,19 @@ def process_app_deployment_request(
|
|||||||
|
|
||||||
deployment_record = laconic.get_record(app_deployment_crn)
|
deployment_record = laconic.get_record(app_deployment_crn)
|
||||||
deployment_dir = os.path.join(deployment_parent_dir, fqdn)
|
deployment_dir = os.path.join(deployment_parent_dir, fqdn)
|
||||||
|
# At present we use this to generate a unique but stable ID for the app's host container
|
||||||
|
# TODO: implement support to derive this transparently from the already-unique deployment id
|
||||||
|
unique_deployment_id = hashlib.md5(fqdn.encode()).hexdigest()[:16]
|
||||||
deployment_config_file = os.path.join(deployment_dir, "config.env")
|
deployment_config_file = os.path.join(deployment_dir, "config.env")
|
||||||
# TODO: Is there any reason not to simplify the hash input to the app_deployment_crn?
|
# TODO: Is there any reason not to simplify the hash input to the app_deployment_crn?
|
||||||
deployment_container_tag = "laconic-webapp/%s:local" % hashlib.md5(deployment_dir.encode()).hexdigest()
|
deployment_container_tag = "laconic-webapp/%s:local" % unique_deployment_id
|
||||||
app_image_shared_tag = f"laconic-webapp/{app.id}:local"
|
app_image_shared_tag = f"laconic-webapp/{app.id}:local"
|
||||||
# b. check for deployment directory (create if necessary)
|
# b. check for deployment directory (create if necessary)
|
||||||
if not os.path.exists(deployment_dir):
|
if not os.path.exists(deployment_dir):
|
||||||
if deployment_record:
|
if deployment_record:
|
||||||
raise Exception("Deployment record %s exists, but not deployment dir %s. Please remove name." %
|
raise Exception("Deployment record %s exists, but not deployment dir %s. Please remove name." %
|
||||||
(app_deployment_crn, deployment_dir))
|
(app_deployment_crn, deployment_dir))
|
||||||
print("deploy_webapp", deployment_dir)
|
logger.log(f"Creating webapp deployment in: {deployment_dir} with container id: {deployment_container_tag}")
|
||||||
deploy_webapp.create_deployment(ctx, deployment_dir, deployment_container_tag,
|
deploy_webapp.create_deployment(ctx, deployment_dir, deployment_container_tag,
|
||||||
f"https://{fqdn}", kube_config, image_registry, env_filename)
|
f"https://{fqdn}", kube_config, image_registry, env_filename)
|
||||||
elif env_filename:
|
elif env_filename:
|
||||||
|
Loading…
Reference in New Issue
Block a user