Skip to content
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

Create documentation for running the OTel Demo on GitHub Codespaces #4725

Open
avillela opened this issue Jun 20, 2024 · 34 comments
Open

Create documentation for running the OTel Demo on GitHub Codespaces #4725

avillela opened this issue Jun 20, 2024 · 34 comments

Comments

@avillela
Copy link
Contributor

I think that it would be helpful to the community to have documentation on running the OTel Demo using GitHub Codespaces. We can do it in one of two ways:

  1. Blog post
  2. Add it to the docs

Thoughts??

@svrnm
Copy link
Member

svrnm commented Jun 20, 2024

thanks @avillela, as you know I always prefer more docs over having blog posts;-) but in that particular case I wonder more about GH codespaces being a commercial solution how well that goes with our social media guide. I might be overly paranoid here, especially sing codespaces is not an o11y product, but I wanted to call that out.

I would enjoy reading such a blog post (or docs page), but I am conflicted on that.

@open-telemetry/demo-approvers @open-telemetry/docs-approvers, wdyt?

@puckpuck
Copy link
Contributor

I'm not even sure it works, but getting the otel-demo to work in a dev container environment and using GitHub Codespaces as an example in a blog post would be okay.

@avillela
Copy link
Contributor Author

avillela commented Jun 21, 2024

I'm not even sure it works, but getting the otel-demo to work in a dev container environment and using GitHub Codespaces as an example in a blog post would be okay.

I did get it running a few weeks back in GH Codespaces - had to beef up the container specs to get it to work and get the various UIs to run 😁

@julianocosta89
Copy link
Member

I'd be okay with it, but as @svrnm mentioned, I believe we should try to keep it as agnostic as possible.
@avillela is there much config difference in running locally with devcontainer and GH Codespaces?

Mastodon project has the .devcontainer definition in its repo and when you open the project, you get a pop up asking if you'd like to open it in codespaces or locally.

The blog/doc could focus on running the demo locally, and if people want to run in Codespaces, they could use the same config, but we as community do not "advertise" it. WDYT?

@puckpuck
Copy link
Contributor

puckpuck commented Jul 2, 2024

+1 to getting a proper .devcontainer definition in the Otel demo so it can work in that world.

@svrnm
Copy link
Member

svrnm commented Jul 3, 2024

Not an expert on the matter, but if there is an OSS solution under codespaces we could support officially that would be my favourite solution.

@avillela
Copy link
Contributor Author

avillela commented Jul 15, 2024

I definitely like the idea @julianocosta89. I can explore a pure devcontainer solution a bit further. Stay tuned!

@avillela
Copy link
Contributor Author

avillela commented Jul 17, 2024

Okay...I created a devcontainer that seems to work (tested it a bunch of times). Check it out here. Before I submit a PR, let me know if you think this is worthwhile, @julianocosta89.

@julianocosta89
Copy link
Member

@avillela I've tried it on my M1 and got the following error:

Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: waiting for init preliminary setup: read init-p: connection reset by peer: unknown

Have you faced something similar?

@avillela
Copy link
Contributor Author

avillela commented Jul 17, 2024

@avillela I've tried it on my M1 and got the following error:

Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: waiting for init preliminary setup: read init-p: connection reset by peer: unknown

Have you faced something similar?

@julianocosta89 Do you get this error when starting up the devcontainer locally?

The issue I've had is that ARM images aren't supported by devcontainers, so the workaround is to first pull the amd64 version of the base image manually before trying to run the devcontainer:

docker pull --platform linux/amd64 mcr.microsoft.com/devcontainers/base:ubuntu

I've tested this successfully in:

Also, I had to tweak the devcontainer.json because it wasn't running properly locally, so you'll need to pull the latest code.

@julianocosta89
Copy link
Member

julianocosta89 commented Jul 18, 2024

@avillela awesome!
I think the ghcr.io/devcontainers/features/docker-in-docker:2 was the missing piece ⭐

It works great!

QQ as we are at it, do we want to focus on the devcontainer just to run the demo, or could we also add the programming languages dependencies and use it to modify the services as well?
With that we could use the guide as a contributing guide too, WDYT?

@julianocosta89
Copy link
Member

Doing some tests, I've just noticed that OpenSearch doesn't start 😢

Disabling OpenSearch Security Plugin
Enabling execution of OPENSEARCH_HOME/bin/opensearch-performance-analyzer/performance-analyzer-agent-cli for OpenSearch Performance Analyzer Plugin
WARNING: Using incubator modules: jdk.incubator.vector
WARNING: A terminally deprecated method in java.lang.System has been called
WARNING: System::setSecurityManager has been called by org.opensearch.bootstrap.OpenSearch (file:/usr/share/opensearch/lib/opensearch-2.14.0.jar)
WARNING: Please consider reporting this to the maintainers of org.opensearch.bootstrap.OpenSearch
WARNING: System::setSecurityManager will be removed in a future release
Jul 18, 2024 6:41:39 AM sun.util.locale.provider.LocaleProviderAdapter <clinit>
WARNING: COMPAT locale provider will be removed in a future release
[2024-07-18T06:41:40,178][WARN ][o.o.b.JNANatives         ] [demo-node] unable to install syscall filter: 
java.lang.UnsupportedOperationException: seccomp unavailable: CONFIG_SECCOMP not compiled into kernel, CONFIG_SECCOMP and CONFIG_SECCOMP_FILTER are needed
        at org.opensearch.bootstrap.SystemCallFilter.linuxImpl(SystemCallFilter.java:375) ~[opensearch-2.14.0.jar:2.14.0]
        at org.opensearch.bootstrap.SystemCallFilter.init(SystemCallFilter.java:666) ~[opensearch-2.14.0.jar:2.14.0]
        at org.opensearch.bootstrap.JNANatives.tryInstallSystemCallFilter(JNANatives.java:281) [opensearch-2.14.0.jar:2.14.0]
        at org.opensearch.bootstrap.Natives.tryInstallSystemCallFilter(Natives.java:128) [opensearch-2.14.0.jar:2.14.0]
        at org.opensearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:129) [opensearch-2.14.0.jar:2.14.0]
        at org.opensearch.bootstrap.Bootstrap.setup(Bootstrap.java:191) [opensearch-2.14.0.jar:2.14.0]
        at org.opensearch.bootstrap.Bootstrap.init(Bootstrap.java:404) [opensearch-2.14.0.jar:2.14.0]
        at org.opensearch.bootstrap.OpenSearch.init(OpenSearch.java:181) [opensearch-2.14.0.jar:2.14.0]
        at org.opensearch.bootstrap.OpenSearch.execute(OpenSearch.java:172) [opensearch-2.14.0.jar:2.14.0]
        at org.opensearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:104) [opensearch-2.14.0.jar:2.14.0]
        at org.opensearch.cli.Command.mainWithoutErrorHandling(Command.java:138) [opensearch-cli-2.14.0.jar:2.14.0]
        at org.opensearch.cli.Command.main(Command.java:101) [opensearch-cli-2.14.0.jar:2.14.0]
        at org.opensearch.bootstrap.OpenSearch.main(OpenSearch.java:138) [opensearch-2.14.0.jar:2.14.0]
        at org.opensearch.bootstrap.OpenSearch.main(OpenSearch.java:104) [opensearch-2.14.0.jar:2.14.0]
./opensearch-docker-entrypoint.sh: line 69:    30 Killed                  "$@" "${opensearch_opts[@]}"

As it doesn't start, we do not get logs in Grafana.

@avillela
Copy link
Contributor Author

avillela commented Jul 18, 2024

Interesting. Have you tried re-strating services (docker compose down followed by docker compose up)? For example, I find sometimes that the Grafana UI doesn't load up initially, and I have to re-start and then it works. I suspect that the same thing may happen for OpenSearch. I only mention this because I just did a test both via local Dev Container and in GH Codespaces and logs are showing for me. Attaching screen shots of logs showing in Grafana.

GitHub Codespaces

Screenshot 2024-07-18 at 10 31 22

Local Dev Container

Screenshot 2024-07-18 at 10 29 11

@avillela
Copy link
Contributor Author

@julianocosta89 to answer your other question, we could definitely expand the Dev Container to enable development as well. It would certainly lower the barrier to contribution.

@avillela
Copy link
Contributor Author

@julianocosta89 another thing to add...so I ran a bunch of tests today, and it does look like eventually I end up getting various IO errors which means that logs aren't always getting through. I spent a ton of time trying to search for a culprit but didn't have any luck. I think it may either be because the devcontainer specs aren't beefy enough (GH codespaces lets me have a max of 4 cores and 16GB RAM, and my own local Docker is restricted at 3 cores and 9GB RAM). Another possibility may be related to the fact that we're running Docker in Docker. Any thoughts?

@avillela
Copy link
Contributor Author

Latest update. I have a new version of the dev container pushed. I based it off of the "Blank" image in GitHub Codespaces that I used for my original pre-devcontainer experiment. It basically includes additional features. I ran a couple of tests and I'm not seeing the weird timeouts that I was seeing before. It also incldues various language runtimes, so we could technically use it as a dev environment too.

@julianocosta89
Copy link
Member

julianocosta89 commented Jul 22, 2024

That looks great @avillela!

The OpenSearch local issue is still ongoing though 😭

Maybe we need to configure CONFIG_SECCOMP, but no idea what are the implications here 🤔

@avillela
Copy link
Contributor Author

@julianocosta89 to confirm - the OpenSearch issue happens when running locally but not in Codespaces?

@julianocosta89
Copy link
Member

@avillela I haven't tried in codespaces, just locally

@avillela
Copy link
Contributor Author

avillela commented Jul 23, 2024

@julianocosta89 I'd be curious to see what happens locally. Also, you're not seeing any logs on your end in Grafana then (assuming that's the case because of the error you're getting)? I only ask because I don't see that error locally on my end. I did a search on the error string that you posted above, and nothing comes up for me. And I can see the logs, both when I locally and remote (GH Codespaces).

@julianocosta89
Copy link
Member

@avillela maybe it is an issue on Mac 🙃

In which OS are you running the demo?

@avillela
Copy link
Contributor Author

@avillela maybe it is an issue on Mac 🙃

In which OS are you running the demo?

I'm running MacOS Sonoma 14.5, and Docker 24.0.2

@julianocosta89
Copy link
Member

I'm on Docker version: 24.0.7
MacOS Sonoma 14.5

🙃

@avillela
Copy link
Contributor Author

One more question - what resources did you dedicate to Docker? I allocated 3 CPUs and 9GB RAM. And are you running anything else in Docker at the same time? It's a beefy image. 🙃

@julianocosta89
Copy link
Member

One more question - what resources did you dedicate to Docker? I allocated 3 CPUs and 9GB RAM. And are you running anything else in Docker at the same time? It's a beefy image. 🙃

Nope, just testing the devcontainer and starting the demo ofc.

I have 10 CPUs and 32GB RAM allocated for Docker, what is extremely high 😅

@avillela
Copy link
Contributor Author

I'm out of ideas. I'm so confused. Can you try to run it remotely in GH Codespaces? Just curious to see what happens.

@avillela
Copy link
Contributor Author

avillela commented Jul 26, 2024

Also, would you be open to pairing on this? I'm out until August 12th, so sometime that week?

@avillela
Copy link
Contributor Author

One other thing that came to mind. Have to tried clearing all of your existing Docker images and volumes to make sure that nothing has been cached?

@julianocosta89
Copy link
Member

@avillela I'll try the codespaces later this week.
And I'd be up to pairing in this one, I'd love to have that working.

When you are back, I'll be out 🙃
I'll be back on the August 26th.

@svrnm svrnm moved this to Need SIG Review in SIG Comms: PRs & Issues Aug 1, 2024
@avillela
Copy link
Contributor Author

@avillela I'll try the codespaces later this week. And I'd be up to pairing in this one, I'd love to have that working.

When you are back, I'll be out 🙃 I'll be back on the August 26th.

Ping me when you get back and we'll set something up!

@julianocosta89
Copy link
Member

@avillela I've tested the devcontainer today and it worked! 🥳

@julianocosta89
Copy link
Member

for some reason flagd didn't start automatically, but docker compose up flagd -d solved.

Another thing that I'm noticing is that for some reason accountingservice is not sending traces 🤔

@avillela
Copy link
Contributor Author

Out of curiosity, is this when running the dev container locally or in GH Codespaces?

@julianocosta89
Copy link
Member

Out of curiosity, is this when running the dev container locally or in GH Codespaces?

devcontainer locally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Need SIG Review
Development

No branches or pull requests

4 participants