Replies: 2 comments 2 replies
-
Hey,
So, what you want to do here is to ask Gramine to add more environment variables when starting emulation of your process. For this, see https://gramine.readthedocs.io/en/latest/manifest-syntax.html#environment-variables. |
Beta Was this translation helpful? Give feedback.
-
Please note that There is no way currently in GSC to have a special treatment "forward all environment variables from the host inside the Gramine SGX enclave". There is no such command-line switch to Instead, as @mkow mentions, you can add the required environment variables to the minimal manifest file that you provide as an input to loader.env.HOSTNAME = { passthrough = true }
loader.env.DEFAULT_SLEEP_INTERVAL = "7100" # note the double-quotes, all envvar values are always in double-quotes! |
Beta Was this translation helpful? Give feedback.
-
I am passing some environment variable through deployment file.
I can see those variable inside the pod but unable to read it from environment.
EX:
[root@k8s-master ]# kubectl exec skcserver-daemonset-ng5dm -- printenv
PATH=/gramine/meson_build_output/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=skcserver-daemonset-ng5dm
SKC_SERVER_PORT=50053
DEFAULT_KEY_CACHE_TIMEOUT=3500
DEFAULT_SESSION_TIMEOUT=14300
DEFAULT_SLEEP_INTERVAL=7100
But i am not able to read these environment variable through my application when running inside gramin.
EX:
In load config of server os.Getenv: sessiontimeout is
In load config of server os.Getenv: sleep interval is
In load config of server os.Getenv: key cache timeout is
In load config of server os.Getenv: skc server port is
They are coming as empty.
In my manifest file i have even allowed:
sgx.allowed_files = [
"file:/etc/environment",
]
While building container image i am providing --insecure-args :
/gsc build --insecure-args skcserver skcserver/skcserver.manifest
Beta Was this translation helpful? Give feedback.
All reactions