-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First iteration and common utils for Jupyter web app CD (#5663)
* ci(utils): Add helpsrs for creating a kaniko task Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com> * ci(utils): Don't always add an exit dag Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com> * cd(jwa): Add CD workflow for building jwa Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com> * ci(utils): Add docker-config Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com> * cicd: Use base-commit[0:8] for the image tag Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com> * cd(config): Add a config file with list of images Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com> * Make CD workflow to be a postsubmit job Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
- Loading branch information
1 parent
a2c8b07
commit 764ce33
Showing
8 changed files
with
148 additions
and
30 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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# This file is only intended for development purposes | ||
|
||
# change this env var based on where kubeflow/testing repo lives | ||
# in your local machine | ||
KUBEFLOW_TESTING_REPO ?= /tmp/kubeflow/testing | ||
KUBEFLOW_KUBEFLOW_REPO ?= /tmp/kubeflow/kubeflow | ||
PYTHONPATH ?= "${KUBEFLOW_KUBEFLOW_REPO}/py:${KUBEFLOW_TESTING_REPO}/py" | ||
|
||
check-local-jwa-kaniko-build: | ||
@PYTHONPATH=${PYTHONPATH} \ | ||
LOCAL_TESTING=True \ | ||
python jwa_runner.py | ||
|
||
check-prod-jwa-kaniko-build: | ||
@PYTHONPATH=${PYTHONPATH} \ | ||
python jwa_runner.py |
Empty file.
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,12 @@ | ||
AWS_REGISTRY = "public.ecr.aws/j1r0q0g6" | ||
|
||
# list of public images | ||
JUPYTER_WEB_APP_IMAGE = "%s/jupyter-web-app" % AWS_REGISTRY | ||
TENSORBOARDS_WEB_APP_IMAGE = "%s/tensorboards-web-app" % AWS_REGISTRY | ||
CENTRAL_DASHBOARD_IMAGE = "%s/central-dashboard" % AWS_REGISTRY | ||
|
||
ADMISSION_WEBHOOK_IMAGE = "%s/admission-webhook" % AWS_REGISTRY | ||
|
||
PROFILE_CONTROLLER_IMAGE = "%s/profile_controller" % AWS_REGISTRY | ||
NOTEBOOK_CONTROLLER_IMAGE = "%s/notebook-controller" % AWS_REGISTRY | ||
TENSORBOARD_CONTROLLER_IMAGE = "%s/tensorboard-controller" % AWS_REGISTRY |
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,44 @@ | ||
""""Argo Workflow for building Jupyter web app's OCI image using Kaniko""" | ||
from kubeflow.kubeflow import ci | ||
from kubeflow.kubeflow.cd import config | ||
from kubeflow.testing import argo_build_util | ||
|
||
|
||
class Builder(ci.workflow_utils.ArgoTestBuilder): | ||
def __init__(self, name=None, namespace=None, bucket=None, | ||
test_target_name=None, **kwargs): | ||
super().__init__(name=name, namespace=namespace, bucket=bucket, | ||
test_target_name=test_target_name, **kwargs) | ||
|
||
def build(self): | ||
"""Build the Argo workflow graph""" | ||
workflow = self.build_init_workflow(exit_dag=False) | ||
task_template = self.build_task_template() | ||
|
||
# Build JWA using Kaniko | ||
dockerfile = ("%s/components/crud-web-apps" | ||
"/jupyter/Dockerfile") % self.src_dir | ||
context = "dir://%s/components/crud-web-apps" % self.src_dir | ||
destination = config.JUPYTER_WEB_APP_IMAGE | ||
|
||
kaniko_task = self.create_kaniko_task(task_template, dockerfile, | ||
context, destination) | ||
argo_build_util.add_task_to_dag(workflow, | ||
ci.workflow_utils.E2E_DAG_NAME, | ||
kaniko_task, [self.mkdir_task_name]) | ||
|
||
# Set the labels on all templates | ||
workflow = argo_build_util.set_task_template_labels(workflow) | ||
|
||
return workflow | ||
|
||
|
||
def create_workflow(name=None, namespace=None, bucket=None, **kwargs): | ||
""" | ||
Args: | ||
name: Name to give to the workflow. This can also be used to name | ||
things associated with the workflow. | ||
""" | ||
builder = Builder(name=name, namespace=namespace, bucket=bucket, **kwargs) | ||
|
||
return builder.build() |
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,12 @@ | ||
# This file is only intended for development purposes | ||
import os | ||
|
||
import yaml | ||
|
||
from kubeflow.kubeflow.cd import jwa | ||
|
||
WORKFLOW_NAME = os.getenv("WORKFLOW_NAME", "jwa-build") | ||
WORKFLOW_NAMESPACE = os.getenv("WORKFLOW_NAMESPACE", "kubeflow-user") | ||
|
||
if __name__ == "__main__": | ||
print(yaml.dump(jwa.create_workflow(WORKFLOW_NAME, WORKFLOW_NAMESPACE))) |
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 @@ | ||
from . import workflow_utils # noqa F401, F403 |
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