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

Mephisto metrics + docker integration misaligned #752

Open
3 tasks
JackUrb opened this issue Apr 7, 2022 · 3 comments
Open
3 tasks

Mephisto metrics + docker integration misaligned #752

JackUrb opened this issue Apr 7, 2022 · 3 comments
Labels
good first issue Good for newcomers

Comments

@JackUrb
Copy link
Contributor

JackUrb commented Apr 7, 2022

Overview

Mephisto metrics is currently not working correctly for docker-based installs of Mephisto. A potential solution has been outlined below, though there's a little exploration to be done first. The final steps for resolving are:

  • Implement steps (1) and (2) of the proposal.
  • Figure out why the resources files aren't available inside of the mounted docker image
  • Resolve the resources issue after diagnosing.
@pringshia
Copy link
Contributor

pringshia commented Apr 8, 2022

Did some more digging and it seems that $OSTYPE is not detected by sh which is what the mephisto metrics install command uses, we should use bash instead.

Debug steps

First enter the docker container:

$ docker build -t mephisto .
$ docker run -it --rm -p 3000:3000 mephisto sh -c "echo \$OSTYPE" # empty output

$ docker run -it --rm -p 3000:3000 mephisto bash -c "echo \$OSTYPE" # correct output
linux-gnu

More verification. Since we use sh to invoke the install script, we never get $OSTYPE to resolve and hit the default case for the switch statement here.

$ sh mephisto/scripts/metrics/install_metrics.sh
Unable to automate install for

With bash:

$ bash mephisto/scripts/metrics/install_metrics.sh

# Now it runs as expected

Proposal

  1. Use bash instead of sh here
  2. Install curl into the Docker image, which mephisto metrics install depends on (and optionally vim - useful for debugging in the image)
    RUN apt-get update && apt-get -y install curl vim
    
  3. Figure out why this error still comes up after running mephisto metrics install:
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 70.6M  100 70.6M    0     0  10.1M      0  0:00:06  0:00:06 --:--:-- 13.4M
cp: cannot stat 'resources/grafana_defaults.ini': No such file or directory
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   671  100   671    0     0   3022      0 --:--:-- --:--:-- --:--:--  3022
100 72.3M  100 72.3M    0     0  6729k      0  0:00:11  0:00:11 --:--:-- 8749k
cp: cannot stat 'resources/mephisto-prometheus-config.yml': No such file or directory
..........................................................................................................................................................................................................................

@JackUrb
Copy link
Contributor Author

JackUrb commented Apr 8, 2022

The proposal here sounds good to me! For part 3 though, I'd guess that somehow the docker container is dropping the contents of the resources/ directory due to .dockerignore not following the ! exclude setup that .gitignore does.

@pringshia
Copy link
Contributor

Hmm, ! should work with the .dockerignore...

Lines starting with ! (exclamation mark) can be used to make exceptions to exclusions. The following is an example .dockerignore file that uses this mechanism:

https://docs.docker.com/engine/reference/builder/#dockerignore-file

@pringshia pringshia added the good first issue Good for newcomers label Apr 11, 2022
@JackUrb JackUrb removed their assignment Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants