Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions helm/gen3/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ dependencies:
repository: "file://../guppy"
condition: guppy.enabled
- name: hatchery
version: 0.1.55
version: 0.1.56
repository: "file://../hatchery"
condition: hatchery.enabled
- name: indexd
Expand Down Expand Up @@ -169,7 +169,7 @@ type: application
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)

version: 0.2.74
version: 0.2.75

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
4 changes: 2 additions & 2 deletions helm/gen3/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# gen3

![Version: 0.2.74](https://img.shields.io/badge/Version-0.2.74-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: master](https://img.shields.io/badge/AppVersion-master-informational?style=flat-square)
![Version: 0.2.75](https://img.shields.io/badge/Version-0.2.75-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: master](https://img.shields.io/badge/AppVersion-master-informational?style=flat-square)

Helm chart to deploy Gen3 Data Commons

Expand Down Expand Up @@ -37,7 +37,7 @@ Helm chart to deploy Gen3 Data Commons
| file://../gen3-network-policies | gen3-network-policies | 0.1.2 |
| file://../gen3-user-data-library | gen3-user-data-library | 0.1.6 |
| file://../guppy | guppy | 0.1.27 |
| file://../hatchery | hatchery | 0.1.55 |
| file://../hatchery | hatchery | 0.1.56 |
| file://../indexd | indexd | 0.1.34 |
| file://../manifestservice | manifestservice | 0.1.33 |
| file://../metadata | metadata | 0.1.32 |
Expand Down
2 changes: 1 addition & 1 deletion helm/hatchery/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.55
version: 0.1.56


# This is the version number of the application being deployed. This version number should be
Expand Down
2 changes: 1 addition & 1 deletion helm/hatchery/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# hatchery

![Version: 0.1.55](https://img.shields.io/badge/Version-0.1.55-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: master](https://img.shields.io/badge/AppVersion-master-informational?style=flat-square)
![Version: 0.1.56](https://img.shields.io/badge/Version-0.1.56-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: master](https://img.shields.io/badge/AppVersion-master-informational?style=flat-square)

A Helm chart for gen3 Hatchery

Expand Down
37 changes: 32 additions & 5 deletions helm/hatchery/templates/workspace-launch-test-cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,20 @@ spec:
number_of_images = len(images_to_test)
number_of_runs = 0

logging.info("Checking for existing workspace for clean up...")
try:
resp = self.get_workspace_status()
except requests.exceptions.RequestException as e:
logging.error(f"Couldn't get status for workspace user. Error: {e}")
if resp.json()["status"] != "Not Found":
logging.info("Found running workspaces. Attempting to terminate...")
try:
self.terminate_workspace()
logging.info("Workspace terminated. Waiting to start testing...")
time.sleep(120)
except requests.exceptions.RequestException as e:
logging.error(f"Couldn't terminate workspace with error : {e}")

for image_name, id in images_to_test.items():
logging.info(f"Testing image: {image_name}")
final_result.append(self.start_workspace_launch_test(image_name, id))
Expand Down Expand Up @@ -341,12 +355,20 @@ spec:

except requests.exceptions.RequestException as e:
error_msg = f"Error connecting to workspace via proxy endpoint. Error: {e}"

# Terminate active running workspace

self.terminate_and_set_logs(image_name, workspace_id, proxy_status_code)


def terminate_workspace(self):
terminate_url = self.commons_url + "/lw-workspace/terminate"
return requests.post(terminate_url, headers= self.headers)


def terminate_and_set_logs(self, image_name, workspace_id, proxy_status_code):
# Terminate active running workspace
try:
logging.info("Attempting to terminate workspace...")
terminate_response = requests.post(terminate_url, headers= self.headers)
terminate_response = self.terminate_workspace()
terminate_response.raise_for_status()
logging.info("Workspace terminated...")
except requests.exceptions.RequestException as e:
Expand All @@ -366,6 +388,12 @@ spec:
"proxy_status": proxy_status_code,
}
return json_result


def get_workspace_status(self):
status_url = self.commons_url + "/lw-workspace/status"
status_response = requests.get(status_url, headers=self.headers)
return status_response


def monitor_workspace_status(self, interval=10, timeout_limit=10):
Expand All @@ -376,11 +404,10 @@ spec:
interval (int, optional): Interval (in seconds) to hit the options endpoint. Defaults to 10 seconds.
timeout_limit(int, optional): Time limit, in minutes, at which a workspace launch is considered a failure.
"""
status_url = self.commons_url + "/lw-workspace/status"

while True:
try:
status_response = requests.get(status_url, headers=self.headers)
status_response = self.get_workspace_status()
status_response.raise_for_status()
except requests.exceptions.RequestException as e:
error_msg = f"Error checking workspace status: {e}"
Expand Down
Loading