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

ci: replace make -C tools with devcluster. #2892

Merged
merged 4 commits into from
Sep 9, 2021
Merged

Conversation

ioga
Copy link
Contributor

@ioga ioga commented Aug 31, 2021

Description

  • Replace the last few parts of circleci that use make -C tools with devcluster.
  • Remove make -C tools run.

Test Plan

CI is green.

Commentary (optional)

Checklist

  • User-facing API changes need the "User-facing API Change" label.
  • Release notes should be added as a separate file under docs/release-notes/.
    See Release Note for details.
  • Licenses should be included for new code which was copied and/or modified from any external code.

@cla-bot cla-bot bot added the cla-signed label Aug 31, 2021
@netlify
Copy link

netlify bot commented Aug 31, 2021

✔️ Deploy Preview for determined-ui canceled.

🔨 Explore the source changes: 853db7f

🔍 Inspect the deploy log: https://app.netlify.com/sites/determined-ui/deploys/613965919ba16b00075a0ffc

@@ -28,10 +14,6 @@ prep-root:
@ln -s $(abspath ../webui/react/build/*) build/webui/react
@ln -s $(abspath ../harness/dist/*.whl) build/wheels/

.PHONY: run
Copy link
Member

Choose a reason for hiding this comment

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

Why not leave make -C tools run intact for a while? I think rigidly forcing devs to transition from one tooling system to another one is an unnecessary burden.

I think there should be at least a couple months after I land make devcluster and before we remove make -C tools run

@ioga ioga changed the title chore: replace make -C tools with devcluster. ci: replace make -C tools with devcluster. Sep 1, 2021
@ioga ioga marked this pull request as ready for review September 1, 2021 22:47
@ioga ioga requested review from hamidzr and hkang1 September 1, 2021 22:47
@hamidzr
Copy link
Contributor

hamidzr commented Sep 1, 2021

sorta related: there is one more place we have a copy of the tools dir and that's used for running the tests locally. in webui/tests/test-cluster. We can leave that for another PR

@ioga
Copy link
Contributor Author

ioga commented Sep 1, 2021

sorta related: there is one more place we have a copy of the tools dir and that's used for running the tests locally. in webui/tests/test-cluster. We can leave that for another PR

Alright, I want get rid of it in this PR, so we are done with this.

@ioga ioga marked this pull request as draft September 1, 2021 23:07
@hkang1
Copy link
Contributor

hkang1 commented Sep 2, 2021

sorta related: there is one more place we have a copy of the tools dir and that's used for running the tests locally. in webui/tests/test-cluster. We can leave that for another PR

Alright, I want get rid of it in this PR, so we are done with this.

🙏 ditto on this

Copy link
Contributor

@hkang1 hkang1 left a comment

Choose a reason for hiding this comment

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

very excited for this work to land (love the branch name :))

@ioga ioga marked this pull request as ready for review September 3, 2021 00:47
@ioga
Copy link
Contributor Author

ioga commented Sep 3, 2021

@hamidzr @hkang1
Okay, I did the webui/tests/test-cluster. Can you please check out this PR and try running it the way you use it on your systems? There was some wild path and env magic in e2e-tests.py I had to update. I am not super sure about it.

Copy link
Contributor

@hamidzr hamidzr left a comment

Choose a reason for hiding this comment

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

it's great to see that we don't need to depend on package-push job before running e2e tests.
the main way I run e2e tests locally is through make test or python ./bin/e2e-tests.py e2e-tests .
there seems to be some issues with the devcluster config. it's complaining about db.image_name.

also, do I need to set an env variable? DOCKER_LOCALHOST? it'd be nice if the user could run local tests without having to figure out their docker networking settings.

python ./bin/e2e-tests.py e2e-tests
setting up the cluster..
--oneshot is only supported in server mode
Traceback (most recent call last):
  File "./bin/e2e-tests.py", line 93, in det_cluster
    cluster_process = setup_cluster(config, f)
  File "./bin/e2e-tests.py", line 78, in setup_cluster
    raise Exception(f"cluster {config['DET_MASTER']} is unreachable")
Exception: cluster http://localhost:8081 is unreachable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./bin/e2e-tests.py", line 203, in <module>
    main()
  File "./bin/e2e-tests.py", line 199, in main
    fn(config)
  File "./bin/e2e-tests.py", line 130, in e2e_tests
    with det_cluster(config):
  File "/usr/lib/python3.6/contextlib.py", line 81, in __enter__
    return next(self.gen)
  File "./bin/e2e-tests.py", line 96, in det_cluster
    teardown_cluster(config, cluster_process.pid)
UnboundLocalError: local variable 'cluster_process' referenced before assignment
make: *** [Makefile:19: test] Error 1
Time: 0h:01m:17s

@@ -158,12 +153,9 @@ def get_config(args):
config["CLUSTER_NAME"] = f"det_test_{args.det_port}"
config["DET_MASTER"] = f"{args.det_host}:{args.det_port}"

env = {}
Copy link
Contributor

Choose a reason for hiding this comment

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

question: is this just for simplifying code or do we need to make this change? the idea is to minimize the effect of env variables when running processes through this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

devcluster rebuilds the master so it's up-to-date; that needs GOPATH/GOBIN setup properly. This means we'd need to add some new variables to make it work, but everyone's setup is different.

My idea is that if you can run devcluster, this test can just use the same environment and also work.

If some env variables are explicitly harmful, maybe we should just filter them out?

Copy link
Contributor

@hamidzr hamidzr Sep 7, 2021

Choose a reason for hiding this comment

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

I'm thinking that being explicit about them could minimize potential surprises that we get but either way works

@ioga
Copy link
Contributor Author

ioga commented Sep 3, 2021

it's great to see that we don't need to depend on package-push job before running e2e tests.
the main way I run e2e tests locally is through make test or python ./bin/e2e-tests.py e2e-tests .
there seems to be some issues with the devcluster config. it's complaining about db.image_name.

can you please update to a recent devcluster? it had a number of changes recently and I wonder if you're just on an old version.

also, do I need to set an env variable? DOCKER_LOCALHOST? it'd be nice if the user could run local tests without having to figure out their docker networking settings.

I never heard about DOCKER_LOCALHOST so not sure what you're asking about. This thing needs devcluster and docker working, but shouldn't require any other advanced setup.

@hamidzr
Copy link
Contributor

hamidzr commented Sep 7, 2021

can you please update to a recent devcluster? it had a number of changes recently and I wonder if you're just on an old version.

let me do that.

the DOCKER_LOCALHOST comes from here I asked that because I remember as part of the devcluster setup I needed to provide it with the interface IP to my docker bridge which is something specific to user setup.

@ioga
Copy link
Contributor Author

ioga commented Sep 7, 2021

ok, let me know.
that $DOCKER_LOCALHOST is devcluster's internal thing it does, basically just a configuration magic. it's not a docker thing. you don't need to set it explicitly in your env.

agent_id: agent3
fluent:
port: 24226 # default value is 24224
container_name: determined-fluent-3
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: pin the agent slot type to be CPU to that the tests run on the same* type of accelerator between local and ci slot_type: cpu

Copy link
Contributor

@hamidzr hamidzr left a comment

Choose a reason for hiding this comment

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

the WebUI e2e tests section looks good to me. You can't run the tests with node version > 14 but that's the same story on master branch as well

@hamidzr
Copy link
Contributor

hamidzr commented Sep 7, 2021

can you please update to a recent devcluster? it had a number of changes recently and I wonder if you're just on an old version.

I asked that because I remember as part of the devcluster setup I needed to provide it with the interface IP to my docker bridge

ftr updating helped. I'm guessing it's because of the newly added feature to guess the host --no-guess-host

Copy link
Contributor

@hkang1 hkang1 left a comment

Choose a reason for hiding this comment

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

This is SOOOOOO much better. Especially the removal of make -C tools from webui/tests! devcluster and make -C webui/tests test worked great for me. Thanks @ioga!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants