Help with profiling GSC workload

26 views
Skip to first unread message

Sudip Maitra

unread,
Mar 8, 2023, 3:26:12 PM3/8/23
to us...@gramineproject.io
Hello,

There are methods mentioned in the gramine docs section about how to profile sgx workloads. I was wondering if the same tools are available for containerized workloads for gsc.

Best regards,
Sudip

Dmitrii Kuvaiskii

unread,
Mar 9, 2023, 6:15:48 AM3/9/23
to Sudip Maitra, us...@gramineproject.io
Dear Sudip,

> There are methods mentioned in the gramine docs section about how to profile sgx workloads. I was wondering if the same tools are available for containerized workloads for gsc.

This is a pretty complex task, but yes, you could do the profiling
inside the GSC-created Docker container.

1. You'll need to add the profiling-required manifest options
(https://gramine.readthedocs.io/en/stable/manifest-syntax.html#sgx-profiling)
to the for-GSC-build manifest.
2. You'll need to modify the GSC internal Dockerfile to use
`debugoptimized` mode:
https://github.com/gramineproject/gsc/blob/a0bb1f54093ed7d0fdcef5f27f66c428ced73dce/templates/Dockerfile.common.compile.template#L31
3. You'll need to modify the GSC internal manifest template to at
least enable `sgx.debug = true`:
https://github.com/gramineproject/gsc/blob/a0bb1f54093ed7d0fdcef5f27f66c428ced73dce/templates/entrypoint.common.manifest.template#L15
4. Now you can build your GSC Docker image.
5. Now enter this Docker image via `docker run -it
--entrypoint=/bin/bash ...`, so you can work with the image in the
usual terminal.
6. Now inside the Docker container, you can do the usual stuff:
`gramine-sgx /gramine/app_files/entrypoint` and check perf
characteristics.

This is a rough sketch, I may have missed some steps. Please try to
play with it yourself.
> --
> You received this message because you are subscribed to the Google Groups "Gramine Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to gramine-user...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/gramine-users/CAOcR%2BfYWLH%2BzdvcxXnKScu9qv5EtYNxS-7pGuJfo-rE_mF1h%3Dw%40mail.gmail.com.



--
Yours sincerely,
Dmitrii Kuvaiskii
Reply all
Reply to author
Forward
0 new messages