apache / openwhisk

Apache OpenWhisk is an open source serverless cloud platform
https://openwhisk.apache.org/
Apache License 2.0
6.56k stars 1.17k forks source link

When creating an action, how do you set the environment variables for the container? #5492

Open kh3654po opened 4 months ago

kh3654po commented 4 months ago

I am creating an action using Rust, and I found /bin/compile.py in the default image used by OpenWhisk, which is openwhisk/action-rust-v1.34:nightly. Upon inspecting the code, I noticed that the RELEASE environment variable must be set in os.environ for the compile option to use the release build. However, I don't know how to set this environment variable.

def build(tgt_dir):
     # support RELEASE
     cmd = ["cargo", "build"]
     bin_dir = "debug"
     if "RELEASE" in os.environ:
         cmd += "--release"
         bin_dir = "release"

How do I set this environment variable?

sciabarracom commented 4 months ago

It should be in the docker file as ENV

Michele Sciabarra CEO - Nuvolaris Inc

On Tue, 16 Jul 2024 at 06:03, kh3654po @.***> wrote:

I am creating an action using Rust, and I found /bin/compile.py in the default image used by OpenWhisk, which is openwhisk/action-rust-v1.34:nightly. Upon inspecting the code, I noticed that the RELEASE environment variable must be set in os.environ for the compile option to use the release build. However, I don't know how to set this environment variable.

def build(tgt_dir):

support RELEASE

 cmd = ["cargo", "build"]
 bin_dir = "debug"
 if "RELEASE" in os.environ:
     cmd += "--release"
     bin_dir = "release"

How do I set this environment variable?

— Reply to this email directly, view it on GitHub https://github.com/apache/openwhisk/issues/5492, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHJ4D34BYS3LLGWWM6OPJRTZMSLSFAVCNFSM6AAAAABK5XQEMSVHI2DSMVQWIX3LMV43ASLTON2WKOZSGQYTAMJVGIYTGMQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>