Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fake-source-cluster for testing the sync service #364

Merged
merged 9 commits into from
Aug 22, 2024

Conversation

saza-ku
Copy link
Contributor

@saza-ku saza-ku commented Aug 20, 2024

What type of PR is this?

/area simulator
/kind feature

What this PR does / why we need it:

This PR adds a kwok cluster that will be the source cluster of import/sync when debugging.
This cluster starts by running make docker_debug.

Which issue(s) this PR fixes:

Part of #327

Special notes for your reviewer:

When you edit simulator/config.yaml to enable externalImportEnabled and run make docker_debug, you will see node-0, node-1 and node-2 in the simulator UI.

/label tide/merge-method-squash

@k8s-ci-robot k8s-ci-robot added area/simulator Issues or PRs related to the simulator. kind/feature Categorizes issue or PR as related to a new feature. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. labels Aug 20, 2024
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 20, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @saza-ku. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 20, 2024
docker-compose-local.yml Outdated Show resolved Hide resolved
@@ -49,6 +53,38 @@ services:
- KWOK_KUBE_APISERVER_PORT=3131
networks:
- simulator-internal-network
debug-real-cluster:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
debug-real-cluster:
fake-real-cluster:

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree that "fake" is more appropriate than "debug".
"debug" seems to overly narrow the intended purpose of the cluster.

However, "fake" and "real" words are contradictory.
How about "fake-source-cluster"?

Makefile Outdated
@@ -68,10 +68,18 @@ docker_up_local:
.PHONY: docker_build_and_up
docker_build_and_up: docker_build docker_up_local

.PHONY: docker_debug
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure we should add a new make command.
Can we implement it as an option in the existing docker_up_local, like:

docker compose up -d --profile $(profiles)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can specify the profiles by an environment variable of COMPOSE_PROFILES, like this.

make docker_up_local -e COMPOSE_PROFILES=externalImportEnabled

So this PR doesn't fix Makefile.

simulator/cmd/simulator/Dockerfile Outdated Show resolved Hide resolved
docker-compose-local.yml Outdated Show resolved Hide resolved
@sanposhiho
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 20, 2024
@@ -49,6 +53,38 @@ services:
- KWOK_KUBE_APISERVER_PORT=3131
networks:
- simulator-internal-network
debug-real-cluster:
Copy link
Contributor

Choose a reason for hiding this comment

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

I agree that "fake" is more appropriate than "debug".
"debug" seems to overly narrow the intended purpose of the cluster.

However, "fake" and "real" words are contradictory.
How about "fake-source-cluster"?

docker-compose-local.yml Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 21, 2024
@saza-ku saza-ku force-pushed the add-test-real-cluster branch from 2692456 to e9a67e5 Compare August 21, 2024 05:38
@ordovicia
Copy link
Contributor

Could you please also update simulator/docs/running-simulator.md to describe how to run the fake source cluster?

@saza-ku saza-ku changed the title Add debug-real-cluster for testing the import service and the sync service Add fake-source-cluster for testing the sync service Aug 21, 2024
@saza-ku
Copy link
Contributor Author

saza-ku commented Aug 21, 2024

Could you please also update simulator/docs/running-simulator.md to describe how to run the fake source cluster?

Updated!

Copy link
Contributor

@ordovicia ordovicia left a comment

Choose a reason for hiding this comment

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

👍

simulator/docs/running-simulator.md Outdated Show resolved Hide resolved
docker-compose-local.yml Show resolved Hide resolved
@saza-ku saza-ku force-pushed the add-test-real-cluster branch from 68c71c4 to 5ab5224 Compare August 22, 2024 01:01
@saza-ku saza-ku requested a review from sanposhiho August 22, 2024 01:02
@@ -3,6 +3,9 @@ services:
simulator-server:
image: registry.k8s.io/scheduler-simulator/simulator-backend:v0.2.0
container_name: simulator-server
volumes:
- ./simulator/config.yaml:/config.yaml
- ./simulator/kubeconfig.yaml:/kubeconfig.yaml
Copy link
Member

Choose a reason for hiding this comment

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

We shouldn't mount this kubeconfig since we don't have fake-source-cluster in this case.

@saza-ku saza-ku force-pushed the add-test-real-cluster branch 2 times, most recently from 4a7a4cb to 38c9288 Compare August 22, 2024 02:37
@saza-ku saza-ku force-pushed the add-test-real-cluster branch from 38c9288 to d6cd2d9 Compare August 22, 2024 02:38
@saza-ku saza-ku requested a review from sanposhiho August 22, 2024 02:38
Copy link
Member

@sanposhiho sanposhiho left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 22, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ordovicia, sanposhiho, saza-ku

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 22, 2024
@k8s-ci-robot k8s-ci-robot merged commit dad23a8 into kubernetes-sigs:master Aug 22, 2024
5 checks passed
YamasouA pushed a commit to YamasouA/kube-scheduler-simulator that referenced this pull request Aug 30, 2024
…#364)

* add debug-real-cluster

* delete init-debug-real-cluster

* rename debug profile to externalImportEnabled

* rename debug-real-cluster to fake-source-cluster

* delete docker_debug and docker_down_debug

* delete config.yaml and kubeconfig.yaml from the image and mount them as volumes

* add description of how to run fake-source-cluster

* fix description of how to run fake-source-cluster

Co-authored-by: Kensei Nakada <[email protected]>

* mount config.yaml and in docker-compose.yml

---------

Co-authored-by: Kensei Nakada <[email protected]>
YamasouA pushed a commit to YamasouA/kube-scheduler-simulator that referenced this pull request Sep 15, 2024
…#364)

* add debug-real-cluster

* delete init-debug-real-cluster

* rename debug profile to externalImportEnabled

* rename debug-real-cluster to fake-source-cluster

* delete docker_debug and docker_down_debug

* delete config.yaml and kubeconfig.yaml from the image and mount them as volumes

* add description of how to run fake-source-cluster

* fix description of how to run fake-source-cluster

Co-authored-by: Kensei Nakada <[email protected]>

* mount config.yaml and in docker-compose.yml

---------

Co-authored-by: Kensei Nakada <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/simulator Issues or PRs related to the simulator. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants