-
Notifications
You must be signed in to change notification settings - Fork 201
docs(timestamps): fix outdated enabling timestamping section #787
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Chennamma-Hotkar
wants to merge
1
commit into
urunc-dev:main
Choose a base branch
from
Chennamma-Hotkar:docs/issue-624-fix-timestamping-guide
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,53 +40,37 @@ Timestamp logging is now handled through a fixed schema using zerolog. The previ | |
|
|
||
| ## How to enable timestamping | ||
|
|
||
| In order to capture the timestamps, a separate `containerd-shim` and container runtime must be configured in your system. | ||
| Timestamping is enabled via urunc's configuration file at `/etc/urunc/config.toml`: | ||
|
|
||
| To create the "timestamping" version of `containerd-shim-urunc-v2`: | ||
|
|
||
| ```bash | ||
| sudo tee -a /usr/local/bin/containerd-shim-uruncts-v2 > /dev/null << 'EOT' | ||
| #!/bin/bash | ||
| URUNC_TIMESTAMPS=1 /usr/local/bin/containerd-shim-urunc-v2 $@ | ||
| EOT | ||
| sudo chmod +x /usr/local/bin/containerd-shim-uruncts-v2 | ||
| ```toml | ||
| [timestamps] | ||
| enabled = true | ||
| destination = "/var/log/urunc/timestamps.log" | ||
| ``` | ||
|
|
||
| To add the "timestamping" urunc to containerd config: | ||
| No separate `containerd-shim` or container runtime configuration is required — urunc reads this setting directly at startup. | ||
|
|
||
| ```bash | ||
| sudo tee -a /etc/containerd/config.toml > /dev/null << 'EOT' | ||
| # timestamping urunc | ||
| [plugins.'io.containerd.cri.v1.runtime'.containerd.runtimes.uruncts] | ||
| runtime_type = "io.containerd.uruncts.v2" | ||
| container_annotations = ["com.urunc.unikernel.*"] | ||
| pod_annotations = ["com.urunc.unikernel.*"] | ||
| snapshotter = "devmapper" | ||
| EOT | ||
| sudo systemctl restart containerd.service | ||
| ``` | ||
| If the destination directory does not exist, urunc logs a warning and disables metrics gracefully instead of crashing. | ||
|
|
||
| ## How to gather timestamps | ||
|
|
||
| Now we need to run a unikernel using the new container runtime `uruncts`: | ||
| Now we need to run a unikernel with timestamping enabled in the config: | ||
|
|
||
| ```bash | ||
| sudo nerdctl run --rm --snapshotter devmapper --runtime io.containerd.uruncts.v2 harbor.nbfc.io/nubificus/urunc/hello-hvt-rumprun:latest | ||
| sudo nerdctl run --rm --snapshotter devmapper --runtime io.containerd.urunc.v2 harbor.nbfc.io/nubificus/urunc/hello-hvt-rumprun:latest | ||
| ``` | ||
|
|
||
| The timestamp logs are located at `/tmp/urunc.zlog`: | ||
| The timestamp logs are located at `/var/log/urunc/timestamps.log`: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change the text here and point to the location defined by the configuration. |
||
|
|
||
| ```console | ||
| $ cat /tmp/urunc.zlog | grep TS | ||
| $ cat /var/log/urunc/timestamps.log | grep TS | ||
| {"containerID":"faaf830245ffab0df81927cebd7f11065e70c7703121fbc1b11d4bca49bab461","timestampID":"TS00","timestampName":"CR.invoked","timestampOrder":0,"time":1703676366849599657} | ||
| {"containerID":"faaf830245ffab0df81927cebd7f11065e70c7703121fbc1b11d4bca49bab461","timestampID":"TS01","timestampName":"CR.unikontainer_created","timestampOrder":1,"time":1703676366850466038} | ||
| {"containerID":"faaf830245ffab0df81927cebd7f11065e70c7703121fbc1b11d4bca49bab461","timestampID":"TS02","timestampName":"CR.initial_setup","timestampOrder":2,"time":1703676366850709857} | ||
| {"containerID":"faaf830245ffab0df81927cebd7f11065e70c7703121fbc1b11d4bca49bab461","timestampID":"TS03","timestampName":"CR.start_reexec","timestampOrder":3,"time":1703676366850900287} | ||
| # ... (rest of the output) | ||
| ``` | ||
|
|
||
| > Note: the timestamp destination (`/tmp/urunc.zlog`) is hardcoded for the time being. | ||
|
|
||
| ## Gathering the timestamps | ||
|
|
||
| There are 3 Python utilities inside the `script/performance` directory to help gather the timestamps. | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having a separate contianerd entry for urunc and timestamps useful. Please take look at https://urunc.io/configuration/#configuration-file-location to see how this can be enabled (two different urunc shims; one for timestamp)