Skip to content

Conversation

mkoushni
Copy link

@mkoushni mkoushni commented Aug 20, 2025

Add standardized Makefile for workspaces/frontend in notebooks-v2
related #528

Description

Introduce a Makefile under workspaces/frontend in the notebooks-v2 branch to streamline common build and deployment workflows for the frontend service.

The Makefile should follow the same structure and conventions already established in the controller and backend components, providing consistency across the project. It should include targets for building, pushing, and deploying the frontend container image, as well as handling cross-platform builds and undeployment from remote clusters.

This enables developers to work with the frontend service in a uniform way without needing custom scripts, ensuring easier onboarding, fewer errors, and alignment with the broader project tooling.

Scope

Place Makefile at the root of workspaces/frontend.

Expose standardized targets:

docker-build: build local frontend image

docker-push: push frontend image to registry

docker-buildx: build/push cross-platform images with BuildKit

deploy: deploy frontend via kustomize into Kubernetes cluster

undeploy: remove frontend resources from the cluster

Include helper targets like help, clean, and dependency installation (e.g., kustomize).

Support overriding image name/tag, container tool, and Kustomize directory through environment variables.

@github-project-automation github-project-automation bot moved this to Needs Triage in Kubeflow Notebooks Aug 20, 2025
@google-oss-prow google-oss-prow bot added area/frontend area - related to frontend components area/v2 area - version - kubeflow notebooks v2 labels Aug 20, 2025
@mkoushni mkoushni force-pushed the makefile_528_cl branch 4 times, most recently from 5d96d21 to 572e8e0 Compare August 21, 2025 10:41
@mkoushni mkoushni changed the title feat(ws): frontend Makefile to support deploy-related tasks #528 feat(ws): frontend Makefile to support deploy-related tasks Aug 26, 2025
@mkoushni mkoushni changed the title feat(ws): frontend Makefile to support deploy-related tasks feat(ws): frontend Makefile to support deploy Aug 26, 2025
@mkoushni mkoushni force-pushed the makefile_528_cl branch 5 times, most recently from b13dd34 to 85c4bf7 Compare August 27, 2025 10:58
.PHONY: deploy
deploy: kustomize ## Deploy frontend to the K8s cluster specified in ~/.kube/config.
cd manifests/kustomize/overlays/istio && $(KUSTOMIZE) edit set image workspaces-frontend=${IMG}
$(KUSTOMIZE) apply -k manifests/kustomize/overlays/istio
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is wrong - should be $(KUBECTL)

As written - trying to run this commend results in:

/Users/astonebe/Development/Code/GitHub/kubeflow-notebooks/workspaces/frontend/bin/kustomize apply -k manifests/kustomize/overlays/istio
Error: unknown command "apply" for "kustomize"
Run 'kustomize --help' for usage.
gmake: *** [Makefile:62: deploy] Error 1

please test your changes before having PR ready for review 🙇


.PHONY: undeploy
undeploy: kustomize ## Undeploy frontend from the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) delete -k manifests/kustomize/overlays/istio --ignore-not-found=true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

@mkoushni mkoushni Aug 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

mkoushni@mkoushni-thinkpadp14sgen2i:~/Applications/Notebook/notebooks/workspaces/frontend$ make deploy
cd manifests/kustomize/overlays/istio && /home/mkoushni/Applications/Notebook/notebooks/workspaces/frontend/bin/kustomize edit set image workspaces-frontend=nbv2-frontend:latest
kubectl apply -k manifests/kustomize/overlays/istio
namespace/kubeflow-workspaces unchanged
service/workspaces-frontend unchanged
deployment.apps/workspaces-frontend unchanged
destinationrule.networking.istio.io/workspaces-frontend created
virtualservice.networking.istio.io/workspaces-frontend created
authorizationpolicy.security.istio.io/workspaces-frontend created

mkoushni@mkoushni-thinkpadp14sgen2i:~/Applications/Notebook/notebooks/workspaces/frontend$ make undeploy
kubectl delete -k manifests/kustomize/overlays/istio --ignore-not-found=true
namespace "kubeflow-workspaces" deleted
service "workspaces-frontend" deleted
deployment.apps "workspaces-frontend" deleted
destinationrule.networking.istio.io "workspaces-frontend" deleted
virtualservice.networking.istio.io "workspaces-frontend" deleted
authorizationpolicy.security.istio.io "workspaces-frontend" deleted

@mkoushni
Copy link
Author

istio crd installation for makefile testing :
helm repo add istio https://istio-release.storage.googleapis.com/charts
helm repo update
helm upgrade --install istio-base istio/base -n istio-system --create-namespace
helm upgrade --install istiod istio/istiod -n istio-system

@mkoushni mkoushni force-pushed the makefile_528_cl branch 3 times, most recently from 6232d4b to d445adf Compare September 2, 2025 14:56
.gitignore Outdated
.LSOverride
._*
._*
/workspaces/frontend/bin/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should be modifying the .gitignore of the frontend directory for better co-locality.

its cleaner to use a relative reference as in the following so its not as sensitive to potential future renames of parent directories

image

@andyatmiami
Copy link
Contributor

/ok-to-test
/lgtm

  • Verified functionality in script is consistent with implementation in backend component
  • Confirmed commands operate as expected

➜ frontend/ git:((HEAD detached at marina/makefile_528_cl)) $ DOCKER_BUILDKIT=0 gmake docker-build IMG=quay.io/rh-ee-astonebe/kubeflow-notebooks-v2:frontend-makefile-test

docker build -t quay.io/rh-ee-astonebe/kubeflow-notebooks-v2:frontend-makefile-test .
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
            BuildKit is currently disabled; enable it by removing the DOCKER_BUILDKIT=0
            environment-variable.

Sending build context to Docker daemon  27.46MB
...
[2/2] COMMIT quay.io/rh-ee-astonebe/kubeflow-notebooks-v2:frontend-makefile-test
--> 2fdeead2c878
Successfully tagged quay.io/rh-ee-astonebe/kubeflow-notebooks-v2:frontend-makefile-test
Successfully tagged quay.io/rh-ee-astonebe/kubeflow-notebooks-v2:makefile-frontend-verify
2fdeead2c8789cbcebeb6b785d2c51f0508dfb0d85588252168f59a94decd528
Successfully built 2fdeead2c878
Successfully tagged quay.io/rh-ee-astonebe/kubeflow-notebooks-v2:frontend-makefile-test

➜ frontend/ git:((HEAD detached at marina/makefile_528_cl)) $ DOCKER_BUILDKIT=0 gmake docker-push IMG=quay.io/rh-ee-astonebe/kubeflow-notebooks-v2:frontend-makefile-test

docker push quay.io/rh-ee-astonebe/kubeflow-notebooks-v2:frontend-makefile-test
The push refers to repository [quay.io/rh-ee-astonebe/kubeflow-notebooks-v2:frontend-makefile-test]
frontend-makefile-test: digest: sha256:d8971cd0e2ba22749b63005ff57e68b40c8ad62eebdaa7bf377499b417015ef7 size: 2156

➜ frontend/ git:((HEAD detached at marina/makefile_528_cl)) $ DOCKER_BUILDKIT=0 gmake deploy IMG=quay.io/rh-ee-astonebe/kubeflow-notebooks-v2:frontend-makefile-test

cd manifests/kustomize/overlays/istio && /Users/astonebe/Development/Code/GitHub/kubeflow-notebooks/workspaces/frontend/bin/kustomize edit set image workspaces-frontend=quay.io/rh-ee-astonebe/kubeflow-notebooks-v2:frontend-makefile-test
kubectl apply -k manifests/kustomize/overlays/istio
namespace/kubeflow-workspaces unchanged
service/workspaces-frontend unchanged
deployment.apps/workspaces-frontend configured
destinationrule.networking.istio.io/workspaces-frontend unchanged
virtualservice.networking.istio.io/workspaces-frontend unchanged
authorizationpolicy.security.istio.io/workspaces-frontend unchanged

➜ frontend/ git:((HEAD detached at marina/makefile_528_cl)) $ gmake clean

rm -rf ./bin ./Dockerfile.cross

➜ frontend/ git:((HEAD detached at marina/makefile_528_cl)) $ gmake undeploy

mkdir -p /Users/astonebe/Development/Code/GitHub/kubeflow-notebooks/workspaces/frontend/bin
Downloading sigs.k8s.io/kustomize/kustomize/[email protected]
kubectl delete -k manifests/kustomize/overlays/istio --ignore-not-found=true
namespace "kubeflow-workspaces" deleted
service "workspaces-frontend" deleted
deployment.apps "workspaces-frontend" deleted
destinationrule.networking.istio.io "workspaces-frontend" deleted
virtualservice.networking.istio.io "workspaces-frontend" deleted
authorizationpolicy.security.istio.io "workspaces-frontend" deleted
  • ℹ️ Note here because we currently deploy the namespace as part of both frontend and backend - calling undeploy has the effect of deleting the backend components. This behavior is currently also present in the backend (in which frontend resources would also get nuked as part of namespace deletion)
    • We should discuss how to handle this longer term outside the scope of this PR - but for now the benefits of this PR (imho) outweigh this edge case - particularly given it already exists in the backend component.

Signed-off-by: Mathew Wicks <[email protected]>
@google-oss-prow google-oss-prow bot removed the lgtm label Sep 4, 2025
@thesuperzapper
Copy link
Member

/ok-to-test

@thesuperzapper
Copy link
Member

Thanks @mkoushni and @andyatmiami, next step is to use this in a CICD test?

/lgtm
/approve

Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: thesuperzapper

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow google-oss-prow bot merged commit d5652e6 into kubeflow:notebooks-v2 Sep 4, 2025
8 of 9 checks passed
@github-project-automation github-project-automation bot moved this from Needs Triage to Done in Kubeflow Notebooks Sep 4, 2025
yashpal2104 pushed a commit to yashpal2104/notebooks that referenced this pull request Sep 7, 2025
* feat(ws): frontend Makefile to support deploy

Signed-off-by: CI Bot <[email protected]>

* mathew: fix 1

Signed-off-by: Mathew Wicks <[email protected]>

---------

Signed-off-by: CI Bot <[email protected]>
Signed-off-by: Mathew Wicks <[email protected]>
Co-authored-by: Mathew Wicks <[email protected]>
bhaktinarvekar pushed a commit to bhaktinarvekar/notebooks that referenced this pull request Sep 14, 2025
* feat(ws): frontend Makefile to support deploy

Signed-off-by: CI Bot <[email protected]>

* mathew: fix 1

Signed-off-by: Mathew Wicks <[email protected]>

---------

Signed-off-by: CI Bot <[email protected]>
Signed-off-by: Mathew Wicks <[email protected]>
Co-authored-by: Mathew Wicks <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved area/frontend area - related to frontend components area/v2 area - version - kubeflow notebooks v2 lgtm ok-to-test size/L

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants