Skip to content

Commit 4892a70

Browse files
authored
Merge pull request #814 from MetaCell/fix-jupyterhub-accounts-dep
CH-21 fix JupyerHub dependency on accounts
2 parents 8db3c26 + d5358a4 commit 4892a70

8 files changed

Lines changed: 9 additions & 25 deletions

File tree

deployment/codefresh-test.yaml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,13 @@ steps:
1313
repo: '${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}'
1414
revision: '${{CF_BRANCH}}'
1515
git: github
16-
post_main_clone:
17-
title: Post main clone
18-
type: parallel
19-
stage: prepare
20-
steps:
21-
clone_cloud_harness:
22-
title: Cloning cloud-harness repository...
23-
type: git-clone
24-
stage: prepare
25-
repo: https://github.com/MetaCell/cloud-harness.git
26-
revision: '${{CLOUDHARNESS_BRANCH}}'
27-
working_directory: .
28-
git: github
2916
prepare_deployment:
3017
title: Prepare helm chart
3118
image: python:3.12
3219
stage: prepare
3320
working_directory: .
3421
commands:
35-
- bash cloud-harness/install.sh
22+
- bash ./install.sh
3623
- harness-deployment . -n test-${{NAMESPACE_BASENAME}} -d ${{DOMAIN}} -r ${{REGISTRY}}
3724
-rs ${{REGISTRY_SECRET}} -e test --write-env --cache-url '${{IMAGE_CACHE_URL}}'
3825
-N -i samples

libraries/cloudharness-common/cloudharness/auth/user_attributes.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import re
21
from keycloak import KeycloakError
32
from .keycloak import AuthClient
4-
from cloudharness.applications import get_current_configuration
5-
from cloudharness_model.models import ApplicationConfig
3+
from cloudharness.auth.exceptions import AuthSecretNotFound
64
from cloudharness import log
75

86

@@ -123,7 +121,7 @@ def get_user_attributes(user_id: str = None, valid_keys={}, default_attributes={
123121
if not user_id:
124122
user_id = auth_client.get_current_user()["id"]
125123
user = auth_client.get_user(user_id, with_details=True)
126-
except KeycloakError as e:
124+
except (KeycloakError, AuthSecretNotFound) as e:
127125
log.warning("Quotas not available: error retrieving user: %s", user_id)
128126
raise UserNotFound("User not found") from e
129127

libraries/cloudharness-common/cloudharness/infrastructure/k8s.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def get_pod_logs(pod_name, namespace=namespace):
7676
except kubernetes.client.rest.ApiException as e:
7777
if e.status == 400:
7878
return f"Pod {pod_name} has not emitted logs yet..."
79-
elif 400 < e.status < 500:
79+
elif 400 < e.status < 500:
8080
return str(e)
8181
raise Exception(e.status) from e
8282

libraries/models/cloudharness_model/models/backup_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def schedule(self, schedule: str):
196196
:type schedule: str
197197
"""
198198
if schedule is not None and not re.search(r'(@(annually|yearly|monthly|weekly|daily|hourly|reboot))|(@every (\d+(ns|us|µs|ms|s|m|h))+)|((((\d+,)+\d+|(\d+(\/|-)\d+)|\d+|\*) ?){5,7})', schedule): # noqa: E501
199-
raise ValueError("Invalid value for `schedule`, must be a follow pattern or equal to `/(@(annually|yearly|monthly|weekly|daily|hourly|reboot))|(@every (\d+(ns|us|µs|ms|s|m|h))+)|((((\d+,)+\d+|(\d+(\/|-)\d+)|\d+|\*) ?){5,7})/`") # noqa: E501
199+
raise ValueError(r"Invalid value for `schedule`, must be a follow pattern or equal to `/(@(annually|yearly|monthly|weekly|daily|hourly|reboot))|(@every (\d+(ns|us|µs|ms|s|m|h))+)|((((\d+,)+\d+|(\d+(\/|-)\d+)|\d+|\*) ?){5,7})/`") # noqa: E501
200200

201201
self._schedule = schedule
202202

libraries/models/cloudharness_model/models/deployment_auto_artifact_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def image(self, image: str):
190190
:type image: str
191191
"""
192192
if image is not None and not re.search(r'(?:[a-z]+\/)?([a-z]+)(?::[0-9]+)?', image): # noqa: E501
193-
raise ValueError("Invalid value for `image`, must be a follow pattern or equal to `/(?:[a-z]+\/)?([a-z]+)(?::[0-9]+)?/`") # noqa: E501
193+
raise ValueError(r"Invalid value for `image`, must be a follow pattern or equal to `/(?:[a-z]+\/)?([a-z]+)(?::[0-9]+)?/`") # noqa: E501
194194

195195
self._image = image
196196

libraries/models/cloudharness_model/models/deployment_auto_artifact_config_all_of.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def image(self, image):
135135
:type image: str
136136
"""
137137
if image is not None and not re.search(r'(?:[a-z]+\/)?([a-z]+)(?::[0-9]+)?', image): # noqa: E501
138-
raise ValueError("Invalid value for `image`, must be a follow pattern or equal to `/(?:[a-z]+\/)?([a-z]+)(?::[0-9]+)?/`") # noqa: E501
138+
raise ValueError(r"Invalid value for `image`, must be a follow pattern or equal to `/(?:[a-z]+\/)?([a-z]+)(?::[0-9]+)?/`") # noqa: E501
139139

140140
self._image = image
141141

tools/deployment-cli-tools/ch_cli_tools/codefresh.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def create_codefresh_deployment_scripts(root_paths, envs=(), include=(), exclude
130130
build_steps = {}
131131
has_overrides = any(DEFAULT_MERGE_PATH in root_path for root_path in root_paths)
132132
for i in range(len(root_paths)):
133-
133+
134134
root_path = root_paths[i]
135135
base_name = clean_image_name(basename(abspath(root_path))) if i < len(root_paths) - (2 if has_overrides else 1) else base_image_name
136136

@@ -160,7 +160,7 @@ def e2e_test_environment(app_config: ApplicationHarnessConfig, app_domain: str =
160160
env = get_app_environment(app_config, app_domain, False)
161161
return [f"{k}={env[k]}" for k in env]
162162

163-
def codefresh_app_build_spec(app_name, app_context_path, dockerfile_path="Dockerfile", base_name=None,
163+
def codefresh_app_build_spec(app_name, app_context_path, dockerfile_path="Dockerfile", base_name=None,
164164
helm_values: HarnessMainConfig = {}, dependencies=None, additional_tags=()):
165165
logging.info('Generating build script for ' + app_name)
166166
title = app_name.capitalize().replace(

tools/deployment-cli-tools/tests/test_helm.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ def test_collect_helm_values_noreg_noinclude(tmp_path):
149149
assert values[KEY_TASK_IMAGES]['cloudharness-base'] == 'testprojectname/cloudharness-base:1'
150150
assert values[KEY_TASK_IMAGES]['myapp-mytask'] == 'testprojectname/myapp-mytask:1'
151151
assert values[KEY_TASK_IMAGES]['my-common'] == 'testprojectname/my-common:1'
152-
153152

154153

155154
def test_collect_helm_values_precedence(tmp_path):

0 commit comments

Comments
 (0)