Initial keytar commit.#2582
Initial keytar commit.#2582thompsonja merged 10 commits intovitessio:masterfrom thompsonja:cluster_test
Conversation
| if keytar_args.config_file: | ||
| with open(keytar_args.config_file, 'r') as yaml_file: | ||
| yaml_config = yaml_file.read() | ||
| if not yaml_config: |
There was a problem hiding this comment.
If keytar_args.config_file is False, yaml_config is not initialized.
|
|
||
| @classmethod | ||
| def tearDownClass(cls): | ||
| os.killpg(cls.flask_process.pid, signal.SIGKILL) |
There was a problem hiding this comment.
Is SIGKILL necessary? Is SIGTERM flaky?
test/cluster/keytar/test_runner.py
Outdated
| '-e', environment_config['application_type'], '-n', name] | ||
| if 'params' in test: | ||
| test_args += ['-t', ':'.join( | ||
| ['%s=%s' % (k, v) for (k, v) in test['params'].iteritems()])] |
There was a problem hiding this comment.
Extraneous inner brackets.
|
Review status: 0 of 17 files reviewed at latest revision, 3 unresolved discussions. test/cluster/keytar/keytar.py, line 201 at r1 (raw file): Previously, dumbunny wrote…
Fixed by making config_file a required flag. test/cluster/keytar/keytar_web_test.py, line 51 at r1 (raw file): Previously, dumbunny wrote…
Swapped with SIGTERM, still works fine. test/cluster/keytar/test_runner.py, line 67 at r1 (raw file): Previously, dumbunny wrote…
Done. Comments from Reviewable |
|
First rounds of comments. (Sorry for the late review.) Reviewed 17 of 17 files at r1, 2 of 3 files at r2. test/cluster/keytar/Dockerfile, line 1 at r2 (raw file):
The component "keytar" as a whole needs a documentation somewhere such that people easily understand what it's doing. Once you have that, you can reference it here. Otherwise, people will go to our Docker hub repo and wonder what the purpose of this image is. test/cluster/keytar/Dockerfile, line 28 at r2 (raw file):
They probably have a generic download URL where the version is not hardcoded? In any case, we have the problem that we'll have to maintain this image in case they make any breaking changes. I think that's fine and given that I would prefer a generic download URL here (if possible). test/cluster/keytar/dummy_test.py, line 2 at r2 (raw file):
Mention here the purpose of this file. test/cluster/keytar/keytar-controller-template.yaml, line 15 at r2 (raw file):
Please push this to our repo instead. test/cluster/keytar/keytar-up.sh, line 10 at r2 (raw file):
I find the "p0" in here misleading. Is there a reason for this? test/cluster/keytar/keytar-up.sh, line 33 at r2 (raw file):
"$addr" because it's a string. Also: Please make this "$ip" because we usually use addr for ip:port (or host:port). test/cluster/keytar/keytar-up.sh, line 34 at r2 (raw file):
echo "Keytar address: http://${addr}:80" test/cluster/keytar/keytar-up.sh, line 37 at r2 (raw file):
echo "Waiting for keytar external IP" to be consistent test/cluster/keytar/keytar.py, line 23 at r2 (raw file):
Comment missing. What are you storing here? When do elements get added/removed? Do some methods use these and can they be moved closer? Can this be moved into an object and the methods be part of that object? This way things would be more self-documenting as well. test/cluster/keytar/keytar.py, line 28 at r2 (raw file):
This needs a comment. test/cluster/keytar/keytar.py, line 38 at r2 (raw file):
I would like to see methods like this further down. I want to be able to read the file from top to bottom, going from the high level implementation to the low level. (I'm not familiar with the Python style guide, but I assume there's no rule which would disallow this?) test/cluster/keytar/keytar.py, line 114 at r2 (raw file):
What if log = "../../var/log/auth"? I could escape out of the testlogs dir and download any file within the container? Keep it simple and restrict it to files only e.g. call os.path.basename on it and then use that? test/cluster/keytar/README.md, line 2 at r2 (raw file):
nit: Docker Hub test/cluster/keytar/README.md, line 2 at r2 (raw file):
Start the first sentence with describing the purpose and then go into the details? I would expect something like this: Keytar is an internal Vitess system which continuously runs cluster tests to test the Vitess integration with Kubernetes. test/cluster/keytar/README.md, line 2 at r2 (raw file):
The relationships between the different components is not clear for me from this. Let's discuss this offline. test/cluster/keytar/README.md, line 4 at r2 (raw file):
inconsistent spelling within this file. Let's always use "Keytar" unless you talk about specific binaries? test/cluster/keytar/README.md, line 6 at r2 (raw file):
Put these in `` here and throughout the file. test/cluster/keytar/README.md, line 18 at r2 (raw file):
Are the terms "keyfile" and "key" the same? It doesn't look like that? What about renaming "KEY" to "PASSWORD" because that's the authentication between the Docker web hook and keytar? test/cluster/keytar/README.md, line 20 at r2 (raw file):
nit: Docker Hub test/cluster/keytar/README.md, line 24 at r2 (raw file):
Dashboard? test/cluster/keytar/README.md, line 31 at r2 (raw file):
FYI: I'm surprised that you don't need a newline between the previous paragraph and this enumeration. This may work with GitHub but I think it doesn't work with the Markdown parser for your website. The same probably applies to the headlines and the following text. This is just an FYI. test/cluster/keytar/config/vitess_p0_config.yaml, line 31 at r2 (raw file):
What's the purpose behind these things? Can we not reuse our bootstrap images? Let's discuss this offline. test/cluster/keytar/config/vitess_p0_config.yaml, line 49 at r2 (raw file):
Why this name? Add a comment here. test/cluster/keytar/config/vitess_p0_config.yaml, line 63 at r2 (raw file):
Let's fix this in the script and not here. I would be fine with adding a single retry there. test/cluster/keytar/static/script.js, line 6 at r2 (raw file):
|
|
Review status: 16 of 17 files reviewed at latest revision, 29 unresolved discussions. test/cluster/keytar/Dockerfile, line 1 at r2 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Referenced the README.md file. test/cluster/keytar/Dockerfile, line 28 at r2 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. test/cluster/keytar/dummy_test.py, line 2 at r2 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. test/cluster/keytar/keytar-controller-template.yaml, line 15 at r2 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. test/cluster/keytar/keytar-up.sh, line 10 at r2 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
It's to parallel the idea of p0 use cases, i.e. primary use cases. I'll just call it vitess_config.yaml test/cluster/keytar/keytar-up.sh, line 33 at r2 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. test/cluster/keytar/keytar-up.sh, line 34 at r2 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. test/cluster/keytar/keytar-up.sh, line 37 at r2 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. test/cluster/keytar/keytar.py, line 23 at r2 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. test/cluster/keytar/keytar.py, line 28 at r2 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. test/cluster/keytar/keytar.py, line 38 at r2 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Sure I don't mind reorganizing. test/cluster/keytar/keytar.py, line 114 at r2 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. test/cluster/keytar/README.md, line 2 at r2 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. test/cluster/keytar/README.md, line 2 at r2 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. test/cluster/keytar/README.md, line 4 at r2 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. test/cluster/keytar/README.md, line 6 at r2 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. test/cluster/keytar/README.md, line 18 at r2 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
keyfile refers to the cloud credential files, whereas key refers to the password encoded in the docker web hook. I'll change it to password. test/cluster/keytar/README.md, line 20 at r2 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. test/cluster/keytar/README.md, line 24 at r2 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. test/cluster/keytar/README.md, line 31 at r2 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Fixed. test/cluster/keytar/config/vitess_p0_config.yaml, line 31 at r2 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Discussed offline, will work on using the bootstrap image. test/cluster/keytar/config/vitess_p0_config.yaml, line 49 at r2 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
I don't think I actually need this if it's running in the same project that will be used to run tests, so I just removed it. test/cluster/keytar/config/vitess_p0_config.yaml, line 63 at r2 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Agreed, I'll do some digging as to why it kept failing for me (plus, this will go away when I use the bootstrap image anyway). test/cluster/keytar/static/script.js, line 6 at r2 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
|
|
Thanks for addressing the comments. Looks good so far. Reviewed 10 of 10 files at r3. test/cluster/keytar/keytar.py, line 189 at r3 (raw file):
nit: Missing period :) test/cluster/keytar/README.md, line 23 at r3 (raw file):
Needs to be updated. Comments from Reviewable |
|
Review status: 13 of 17 files reviewed at latest revision, 15 unresolved discussions. test/cluster/keytar/keytar.py, line 189 at r3 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. test/cluster/keytar/README.md, line 2 at r2 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Reworded (and discussed offline). test/cluster/keytar/README.md, line 23 at r3 (raw file): Previously, mberlin-bot (Michael Berlin) wrote…
Done. Comments from Reviewable |
Wanted to get this out for some initial comments while I'm on vacation. There's still some minor cleanup that's needed (comments, docs, etc.), but generally the gist is there. I went with the name keytar, I'll have to backronym that later...
After this commit, we can add a dockerhub webhook that points to a running instance of keytar on GKE. Every new image will fire a json payload to the instance, triggering a cluster test run to fire using the GKE resources of the project that keytar is running under. This will result in tests running on actual cloud resources and can be considered as post-submit tests. We can discuss later how to react better to these tests.
This commit includes a small front-end that displays test results, dockerfile for creating the docker image, kubernetes templates, unit tests/webdriver tests, and some (admittedly light) documentation.
@michael-berlin
@dumbunny for python readability.