Cannot call `source` within `do_install` stage of hab plan


#1

I am calling source in the do_install stage of my plan as so.

do_install() {
  pushd $pkg_prefix || exit 1
  python3 -m pip install --upgrade pip setuptools wheel
  python3 -m venv env
  source env/bin/activate
  python setup.py develop
  python setup.py install
  popd || exit 1
}

This works fine for me locally, I can load the service & it will run as usual.
However on a remote machine I get the following error

Feb 13 14:52:29 test-mpe.vmw.services hab[1183]: mprocessor.default(E): /hab/svc/mprocessor/run: 5: /hab/svc/mprocessor/run: source: not found

When I ssh onto this remote machine, I can call source without issue on the OS & within hab studio.
Any help appreciated.


#2

Can you also please provide the contents of your run hook?


#3

The run hook is as so,

#!/bin/sh -xe
export MP_ENV={{cfg.environment.env}}
export MP_LOG_LEVEL={{cfg.environment.log_level}}
export MP_CONFIG_DIR={{pkg.svc_config_path}}
. {{pkg.path}}/env/bin/activate
cd {{pkg.path}}
start_mp