Closed gatici closed 1 year ago
We found that this is ignored because of the ops version which is < 2.2.
We need to update ops version.
The problem still exists with ops 2.4.1 (latest available version).
It looks like you're using Pebble in the context of Juju and ops, correct? If so, we only just updated the version of Pebble in Juju to the latest, but those versions of Juju haven't been released yet. Service working-dir
will be available in Juju 3.1.6 and 3.2.2 (neither of which have been released yet).
Unfortunately older versions of Pebble don't return an error on unknown fields in the JSON API, so you don't get an error on older versions.
In the meantime (while waiting for the new versions of Juju), it's probably best to use a workaround, for example, make the command /bin/sh -c 'cd /app/osm_nbi && python3 -m osm_nbi.nbi'
. That will be compatible with older versions of Juju/Pebble.
Confirmed @gatici is using an older 2.9.x version of Juju which doesn't have this feature.
Hello, We are using working-dir in the services to set the current directory for service.
"services": { "nbi": { "override": "replace", "summary": "nbi service", "command": "python3 -m osm_nbi.nbi", "startup": "enabled", "user": "appuser", "group": "appuser", "working-dir": "/app/osm_nbi", "environment": {...} }
Here is the charm file. https://osm.etsi.org/gerrit/#/c/osm/devops/+/13704/1/installers/charm/osm-nbi/src/charm.py
We are using following rockcraft yaml to build the image.
https://osm.etsi.org/gerrit/#/c/osm/NBI/+/13702/1/rockcraft.yaml
However, when the service started it uses / directory as path.
We saw from the output of
pebble plan
that "working-dir" is ignored.