-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In 5369fc6 ingress configuraiton was made more configurable but the defaults were removed and that broke vdk-server Now installation fails with error like -Stderr output: Error: INSTALLATION FAILED: release vdk failed, and has been uninstalled due to atomic being set: Ingress.extensions "vdk-pipelines-control-service" is invalid: spec: Invalid value: []networking.IngressRule(nil): either `defaultBackend` or `rules` must be specified Testing Done: tests
- Loading branch information
1 parent
7c993c9
commit 113cbd8
Showing
7 changed files
with
80 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ kubernetes | |
pytest | ||
pytest-cov | ||
vdk-core | ||
vdk-test-utils |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
projects/vdk-plugins/vdk-server/src/vdk/plugin/server/helm-values.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Copyright 2021-2024 VMware, Inc. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
ingress: | ||
hosts: | ||
- name: "localhost" | ||
paths: | ||
- path: /data-jobs | ||
serviceName: "{{ .Release.Name }}-svc" | ||
servicePort: 8092 | ||
- path: / | ||
serviceName: "{{ .Release.Name }}-ui" | ||
servicePort: 8091 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,8 +51,18 @@ class Installer: | |
git_server_admin_email = "[email protected]" | ||
git_server_repository_name = "vdk-git-repo" | ||
|
||
def __init__(self): | ||
def __init__(self, server_id: str = ""): | ||
self.git_server_image = "gogs/gogs:0.12" | ||
self.__current_directory = self.__get_current_directory() | ||
if server_id: | ||
self.kind_cluster_name = f"{self.kind_cluster_name}-{server_id}" | ||
self.docker_registry_container_name = ( | ||
f"{self.docker_registry_container_name}-{server_id}" | ||
) | ||
self.helm_installation_name = f"{self.helm_installation_name}-{server_id}" | ||
self.git_server_container_name = ( | ||
f"{self.git_server_container_name}-{server_id}" | ||
) | ||
|
||
def install(self): | ||
""" | ||
|
@@ -243,7 +253,7 @@ def __create_git_server_container(self): | |
else: | ||
# docker run --name=vdk-git-server -p 10022:22 -p 10080:3000 -p 10081:80 gogs/gogs:0.12 | ||
docker_client.containers.run( | ||
"gogs/gogs:0.12", | ||
self.git_server_image, | ||
detach=True, | ||
name=self.git_server_container_name, | ||
ports={"22/tcp": "10022", "3000/tcp": "10080", "80/tcp": "10081"}, | ||
|
@@ -612,20 +622,22 @@ def __install_helm_chart(self): | |
if result.returncode != 0: | ||
stderr_as_str = result.stderr.decode("utf-8") | ||
log.error(f"Stderr output: {stderr_as_str}") | ||
exit(result.returncode) | ||
sys.exit(result.returncode) | ||
result = subprocess.run(["helm", "repo", "update"], capture_output=True) | ||
if result.returncode != 0: | ||
stderr_as_str = result.stderr.decode("utf-8") | ||
log.error(f"Stderr output: {stderr_as_str}") | ||
exit(result.returncode) | ||
sys.exit(result.returncode) | ||
helm_command = self.__helm_install_command(git_server_ip) | ||
log.debug(f"Running helm command: {helm_command}") | ||
result = subprocess.run( | ||
self.__helm_install_command(git_server_ip), | ||
helm_command, | ||
capture_output=True, | ||
) | ||
if result.returncode != 0: | ||
stderr_as_str = result.stderr.decode("utf-8") | ||
log.error(f"Stderr output: {stderr_as_str}") | ||
exit(result.returncode) | ||
sys.exit(result.returncode) | ||
else: | ||
log.info("Control Service installed successfully") | ||
except Exception as ex: | ||
|
@@ -680,9 +692,9 @@ def __helm_install_command(self, git_server_ip): | |
"--set", | ||
"deploymentDockerRegistryType=generic", | ||
"--set", | ||
f"deploymentDockerRepository={self.docker_registry_container_name}:5000", | ||
f"deploymentDockerRepository={self.docker_registry_container_name}:{self.__docker_registry_port}", | ||
"--set", | ||
"proxyRepositoryURL=localhost:5000", | ||
f"proxyRepositoryURL=localhost:{self.__docker_registry_port}", | ||
"--set", | ||
f"deploymentGitUrl={git_server_ip}/{self.git_server_admin_user}/{self.git_server_repository_name}.git", | ||
"--set", | ||
|
@@ -705,6 +717,8 @@ def __helm_install_command(self, git_server_ip): | |
"datajobTemplate.template.spec.successfulJobsHistoryLimit=5", | ||
"--set", | ||
"datajobTemplate.template.spec.failedJobsHistoryLimit=5", | ||
"-f", | ||
self.__current_directory.joinpath("helm-values.yaml"), | ||
] | ||
|
||
def __uninstall_helm_chart(self): | ||
|
@@ -786,7 +800,7 @@ def __finalize_configuration(): | |
write_default_rest_api_url("http://localhost:8092") | ||
except Exception as ex: | ||
log.error(f"Failed to finalize installation. {str(ex)}") | ||
exit(1) | ||
sys.exit(1) | ||
log.info("Done") | ||
|
||
@staticmethod | ||
|
@@ -796,7 +810,7 @@ def __cleanup_configuration(): | |
reset_default_rest_api_url() | ||
except Exception as ex: | ||
log.error(f"Failed to clean up. {str(ex)}") | ||
exit(1) | ||
sys.exit(1) | ||
log.info("Done") | ||
|
||
@staticmethod | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Copyright 2021-2024 VMware, Inc. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
from click.testing import Result | ||
from vdk.plugin.server import server_plugin | ||
from vdk.plugin.test_utils.util_funcs import cli_assert_equal | ||
from vdk.plugin.test_utils.util_funcs import CliEntryBasedTestRunner | ||
|
||
|
||
def test_install(): | ||
runner = CliEntryBasedTestRunner(server_plugin) | ||
|
||
result: Result = runner.invoke(["server", "--uninstall"]) | ||
cli_assert_equal(0, result) | ||
|
||
result: Result = runner.invoke(["server", "--install"]) | ||
|
||
cli_assert_equal(0, result) |