icflorescu / openshift-cartridge-nodejs

Custom cartridge for OpenShift providing the lastest version of Node.js.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem with auto scaling

phw opened this issue · comments

When scaling up an application with this cartridge, the newly instantiated gear will always install the latest node version regardless of the .openshift/NODE_VERSION_URL marker. This is because the gear is first setup and then the content is synced over. So during the setup the $OPENSHIFT_REPO_DIR is still empty.

I don't know yet how to properly solve this. I think the cartridge should check the and update the nodejs version in some other hook, but I have not found any good information what hooks are called in which order for newly setup scaled gears.

But I have a workaround implemented at phw@50469aa . This commit allows the node.js version be specified via the environment variable NODE_VERSION_URL. Since the environment is made available to new gears immediately it will be setup with the correct version.

I'll merge your workaround if you don't mind :-)

This appears to be working now, so I'm closing the issue. Thanks a lot!