The Wayback Machine - https://web.archive.org/web/20201110190130/https://github.com/meilisearch/MeiliSearch/issues/712
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

No commitSha on /version when running MeiliSearch from Docker #712

Open
eskombro opened this issue May 26, 2020 · 3 comments
Open

No commitSha on /version when running MeiliSearch from Docker #712

eskombro opened this issue May 26, 2020 · 3 comments

Comments

@eskombro
Copy link
Member

@eskombro eskombro commented May 26, 2020

When running MeiliSearch from Docker, the route /version returns a comitSha value as UNKNOWN

how to reproduce

docker run -it -p 7700:7700 getmeili/meilisearch:latest ./meilisearch --no-analytics=true

curl http://localhost:7700/version

RESPONSE:

{"commitSha":"UNKNOWN","buildDate":"2020-04-28T14:24:40.454854787+00:00","pkgVersion":"0.10.1"}
@eskombro eskombro changed the title No commitSha on /version when running from Docker No commitSha on /version when running MeiliSearch from Docker May 26, 2020
@MarinPostma
Copy link
Contributor

@MarinPostma MarinPostma commented May 28, 2020

We spent some time investigating this with @eskombro yesterday, and could not come up with a reasonable solution. The trick would be to copy the .git folder over in the wordir used by docker to build the binary, as vergen, the dependency we use to retrieve this info, looks at .git/HEAD. A nicer solution IMO would be for the production container to use github release binary instead of the one built in the current recipe

@Kerollmops
Copy link
Member

@Kerollmops Kerollmops commented May 28, 2020

Yes, the problem is due to the .git folder not being accessible by the vergen dependency.
As you said we can either copy the .git/HEAD file to the docker build container.

Using the github release binary inside of the docker container will probably be harder to do because both, the docker and the binaries are currently built at the same time, and therefore the docker image will not be able to access the binaries. I think with Github Action we could specify that a certain build must run after another one, we should look into that.

If we do so we will have to create two GA pipelines, one for the common PRs and one for the releases.

@MarinPostma
Copy link
Contributor

@MarinPostma MarinPostma commented May 28, 2020

If we do so we will have to create two GA pipelines, one for the common PRs and one for the releases.

that seems like a reasonable solution

Also build time for the container is up to 15min (we checked yesterday with @eskombro), it may not be desirable when you only want to run the container right away

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.