OPS-1850: use nodeenv for edxapp - #3444
Conversation
|
@maxrothman How should I go about testing this? |
|
I think building a sandbox off of this branch would work. |
|
ok, nodeenv.sandbox.edx.org is launching |
|
@bjacobel it's probably going to fail because I don't think nodeenv is in edxapp's requirements EDIT: verified. Apps that use nodeenv have it in their requirements.txt, edx-platform does not. I'll make a quick PR. |
|
@bjacobel have you had a chance to test yet? |
3ad270e to
7b6418b
Compare
|
@maxrothman I haven't, I didn't check the first sandbox I built after you said it would probably fail. Now that edx/edx-platform#13890 is merged I will build a box with |
|
@maxrothman Got an error building the sandbox: http://jenkins.edx.org:8080/view/Ansible/job/ansible-provision/9885/ Could be I just configured something wrong, I've never launched one with a non-master configuration version before. You probably know much more about this than me, you want to just ping me when there's a box I can SSH into and poke around? |
|
It's an issue with my code. Hang on, I'll fix it. EDIT: @bjacobel fixed |
7b6418b to
7ca232d
Compare
|
@bjacobel I built this sandbox from scratch. Though the build failed, it got past the edxapp section so you should be able to use it for testing. |
|
I SSHed in and did some poking around, everything seemed ok up until the point I started trying to run things with node modules that (I think?) should be installed on sandboxes. (everything looked ok up to this point) Can't find any node modules in this nodeenv. Or maybe I'm not actually in the nodeenv? It's confusing because I named the sandbox nodeenv. But none of the node modules I would expect to be installed are in |
|
@bjacobel let's connect later this morning and figure it out. |
|
👍 maxrothman.sandbox.edx.org is looking good with these changes |
da744a3 to
7ca232d
Compare
|
Tests are running in https://github.com/edx/configuration/pull/3449 because this requires a change on master in edx-platform but the tests run on release. |
|
Tests have passed in #3449 |
|
I'm 👍 for this change. @benpatterson is there anything you'd like to see before merging this? |
|
I'd look for some solution in the jenkins_worker role; that's currently using the chrislea PPA and that's how we'll be executing tests.... Where did you see that in the overall plan? Do we move one without the other? |
|
@benpatterson Hmm, I'm a little surprised the worker is using different code -- I hadn't realized that when we discussed last week. I think they should be the same, but that the key thing is that we are using the same node and npm versions. The chrislea PPA is not available for xenial, so I think moving the nodeenv is the right thing to do. Who can we talk to about your usecases for node/npm? |
|
@e0d Oh, I am totally on board with moving to nodeenv. I was moreso pointing out this. I think the reason that's there today might be legacy...when it was originally added, we did not have the What I was also inferring was that using nodeenv has not been built into edxapp CI yet. Currently it's using the node/npm versions it finds on the machine it's running on (supplied by the Happy to take this offline...it's a somewhat strategic/logistical set of questions. But I think we want the same thing here ultimately: both the test and prod infrastructures to be as similar as possible. |
|
I'd really like to take the steps to ensure that we're testing the same we we deploy. Doesn't feel like this would be a huge effort, but I'd like to talk through the repercussions. @nedbat FYI |
|
|
||
| - name: create nodeenv | ||
| shell: > | ||
| {{ edxapp_venv_dir }}/bin/nodeenv {{ edxapp_nodeenv_dir }} --node={{ edxapp_node_version }} --prebuilt |
There was a problem hiding this comment.
If you use --force then this can be idempotent
There was a problem hiding this comment.
The creates arg below means that it won't attempt to create it when the directory is present. However, this won't replace a nodeenv with the wrong node version. Are you saying we should ditch creates and only use --force? That's not how we're doing it elsewhere.
I think the right approach might be to make that change in all the places that create nodeenvs in a separate PR.
There was a problem hiding this comment.
Ah I missed the creates arg. No, you are right...that's how idempotency is achieved. I was more concerned with running the same script twice than I was changing the node version. Perhaps you need to register the node version and ensure that's what was created?
There was a problem hiding this comment.
The more I think about it, the more I think creates actually does the wrong thing. I think --force is safer, but we should do it in a separate PR in all the places that make nodeenvs.
This change: * gives us the flexibility of managing node from pull-request to pull-request. It'll be a huge lift to folks that want to test out node upgrades like @bjacobel or @andy-armstrong * Sets us up for a port to Xenial, which will be accomplished in part by using nodeenv for managing the node environment. See a companion PR on the configuration repo for edxapp: edx/configuration#3444 This pull request does not: * Attempt to solve any stability issues in builds related to node. * Make node installs any faster * Create any caching infrastructure to speed up node installs. They will be approximately as fast as they were before. Downloading the node bits build-to-build adds about 3 seconds, which is worth it for the added flexibility.
This change: * gives us the flexibility of managing node from pull-request to pull-request. It'll be a huge lift to folks that want to test out node upgrades like @bjacobel or @andy-armstrong * Sets us up for a port to Xenial, which will be accomplished in part by using nodeenv for managing the node environment. See a companion PR on the configuration repo for edxapp: edx/configuration#3444 This pull request does not: * Attempt to solve any stability issues in builds related to node. * Make node installs any faster * Create any caching infrastructure to speed up node installs. They will be approximately as fast as they were before. Downloading the node bits build-to-build adds about 3 seconds, which is worth it for the added flexibility.
|
Closing the loop on this, I am 👍 |
|
🎉 |
@edx/devops @bjacobel