Page MenuHomePhabricator

service-runner should allow deployment configuration
Closed, ResolvedPublic1 Estimated Story Points

Description

The deploy stanza was removed from package.json in service-template-node which broke the ability for things like node version and docker base image to be configured (code where that happens is here).
Add the ability for service-runner to accept a new way to configure these values.

Event Timeline

• nnikkhoui claimed this task.
• nnikkhoui updated the task description. (Show Details)
• nnikkhoui renamed this task from service-runner should allow configuring a base docker image to service-runner should allow deployment configuration.Apr 26 2021, 7:07 PM
• nnikkhoui updated the task description. (Show Details)

@Pchelolo i broke this in my service-template-node patch that removed deploy and targets.yaml. Was thinking of just adding it back, unless you have a reason not to/there's another place those things could be configured. Or if we want to just make devs customize the Dockerfile themselves (but that doesn't seem like a great option)

What exactly broke?

The deploy stanza in package.json is a part of an old (scap3) deployment system. Services deployed on k8s don't need that system. What do you want it for?

@Pchelolo For creating a local docker env. The deploy stanza is used by service-runner to configure some things in the Dockerfile.
https://github.com/wikimedia/service-runner/blob/master/lib/docker.js#L139

Since you are deploying to k8s, you now need to have .pipeline folder and use https://wikitech.wikimedia.org/wiki/Blubber to generate correct docker files.

We are also doing that ya! But this was for a local docker setup. In the future, anyone else who updates/forks service-template-node and wants to set values like node version or base image, won't be honored. So it should still be fixed shouldn't it?

You can write in the docs that it's a deprecated feature is is only left for backwards compatibility. As soon as we knock down last services deployed with scap, it should be removed.

For local setup, locally, you can do something like

~/go/bin/blubber .pipeline/blubber.yaml test | docker build -t service_test | docker run service_test

Cool cool, I can update the README and MW docs.
Ok couple more qs!

  1. When you say removed, you mean remove all the code in service-runner that reads from that stanza right?
  2. If that code is removed, devs would then just expected to customize their Dockerfile themselves for whatever local setup they needed ya?

When you say removed, you mean remove all the code in service-runner that reads from that stanza right?

yes.

If that code is removed, devs would then just expected to customize their Dockerfile themselves for whatever local setup they needed ya?

Expected to write a blubber file and use blubber for that. Blubber is a replacement for this custom tool in service-runner.

• WDoranWMF set the point value for this task to 1.Apr 28 2021, 4:39 PM

This task resulted in documenting the deprecation of use of service-runner's docker scripts, in favor of using Blubber.
https://github.com/wikimedia/service-template-node/pull/150#event-4659157477