filibuster-testing / filibuster-documentation

Filibuster documentation.
Apache License 2.0
1 stars 0 forks source link

Issues during Tutorial Setup #2

Open ks0ng opened 2 years ago

ks0ng commented 2 years ago

Hi,

I am excited to learn about filibuster, as I am facing similar challenges and exploring options. However, I ran into some issues when trying to go through the following tutorials:

  1. Blog Tutorial: https://christophermeiklejohn.com/filibuster/2021/10/08/filibuster-3.html
  2. Home page Tutorial: https://filibuster.cloud/tutorial.html

For the blog tutorial, I managed to install all the dependencies and install filibuster locally and made the 3 micro services to run. They all pass the health check, but the filibuster instrumentation would fail due to bad URL.

  File "/Users/kaisong/src/filibuster-tutorial/filibuster/filibuster/instrumentation/requests/__init__.py", line 151, in instrumented_request
    response = _instrumented_requests_call(
  File "/Users/kaisong/src/filibuster-tutorial/filibuster/filibuster/instrumentation/requests/__init__.py", line 230, in _instrumented_requests_call
    response = wrapped_request(self, 'get',
...
requests.exceptions.MissingSchema: Invalid URL 'None/filibuster/new-test-execution/bar': No scheme supplied. Perhaps you meant http://None/filibuster/new-test-execution/bar?

I looked into the code, it looks like I need to have filibuster daemon running to have a valid URL. I am not able to find the according tutorials on that. If I go with this route, what's the best way to start filibuster? Do I need to spin up a docker instance and potentially set up jaeger tracing? The example makefile seems to indicate that.

For the home page tutorial, I managed to follow the steps and run make local-start successfully. However, the services don't seem to run:

(venv) $ make local-start
find . -name ".coverage*" -exec rm -v {} \;
./.coverage
./services/foo/.coverage.kaisong-C02XM4J9JGH6.30560.291567
./services/baz/.coverage.kaisong-C02XM4J9JGH6.30593.350616
./services/bar/.coverage.kaisong-C02XM4J9JGH6.30576.149539
rm -rf htmlcov
make generate-protos
Generating protocol buffer files...
if [ -d "protos/" ]; then \
        mkdir -p protos/out; \
        python3 -m grpc_tools.protoc -I./protos --python_out=protos/out --grpc_python_out=protos/out ./protos/*.proto; \
        make install-protos; \
    fi
tmux new-session -d -s application
cd services/foo; make start
tmux new-window -t application -n foo -d 'coverage run --parallel-mode -m foo.app'
cd services/bar; make start
tmux new-window -t application -n bar -d 'coverage run --parallel-mode -m bar.app'
cd services/baz; make start
tmux new-window -t application -n baz -d 'coverage run --parallel-mode -m baz.app'
(venv) $ curl http://localhost:5001/health-check
curl: (7) Failed to connect to localhost port 5001 after 8 ms: Connection refused
(venv) $ curl http://localhost:5002/health-check
curl: (7) Failed to connect to localhost port 5002 after 8 ms: Connection refused

For both tutorials, I was not able to continue with the rest of the steps after encountering the above issues. Are there any missing steps that I need to set up for all the dependencies?

Again, I am excited to learn more about filibuster and the problem it tries to solve. A quick side question, do we have any plans to expand the support for Go micro services? Also, do we plan to keep filibuster open source so that the community can contribute?

Thanks in advance!

Kai

cmeiklejohn commented 2 years ago

Thanks for the interest, I really appreciate it. Yes, this work will remain open source, of course! We currently do not have any plans for Go, mainly because I just do not have time to implement something myself not knowing Go at all, but I would love to have a version for Go, if possible. We have a very nice Java implementation that will be open source soon, that makes most of the Python work look like a beta version.

Regarding the server, that's started by the filibuster command line tool, you do not need to start it. I'm not sure why you're seeing that URL issue when trying to communicate with the server, but I think the best place to start is to get the local-start command working: I'm not sure why it's not working for you, I did just have a student working with it and it was working fine for her, so my guess is that it is a dependency issue. I think that's where we should start debugging this.

I guess the first question is, the make local-start talk requires tmux. Do you have tmux installed? If so, can you run one of those tmux lines you see in the output and see if it actually starts the services?

ks0ng commented 2 years ago

Thanks for getting back on this! I do have tmux on my system, but the service start command coverage run --parallel-mode -m $(SERVICE).app doesn't work, so I replaced it in the shared_build_services.mk file to run the flask service manually:

-       tmux new-window -t application -n $(SERVICE) -d 'coverage run --parallel-mode -m $(SERVICE).app'
+       FLASK_APP=$(SERVICE)/app.py flask run -h localhost -p $(PORT) &

Then, I was able to finish the tutorial!

In addition, I found out the reason for the invalid URL issues when I tried to follow the blog tutorial. The code for make local-start uses a helper.py to load the filibuster hostname and port from the networking.json file. Are there other ways to load these without using the helper.py? It's a bit counter intuitive, because I was expecting the networking.json file is only used for running docker.

cmeiklejohn commented 2 years ago

Did you try pip install coverage and then try start command? I wonder if coverage needs to be explicitly installed: we use coverage in order to generate coverage reports from the Filibuster runs.

cmeiklejohn commented 2 years ago

In addition, I found out the reason for the invalid URL issues when I tried to follow the blog tutorial. The code for make local-start uses a helper.py to load the filibuster hostname and port from the networking.json file. Are there other ways to load these without using the helper.py? It's a bit counter intuitive, because I was expecting the networking.json file is only used for running docker.

This was done explicitly to make running the examples that come with the paper as part of the corpus easy to use.

In our Java instrumentation, we do something much simpler: either read the URL from an environment variable called FILIBUSTER_URL that can be set before running the program or through a Java system property that can be specified in a gradle file or JVM runtime configuration option.