nomad-coe / nomad

NOMAD lets you manage and share your materials science data in a way that makes it truly useful to you, your group, and the community.
https://nomad-lab.eu
Apache License 2.0
64 stars 14 forks source link

Unclear installation procedure and out of date requirements #39

Closed BlackLotus closed 1 year ago

BlackLotus commented 1 year ago

I'm in the ongoing process of trying to get nomad running on my Ubuntu 22.04 Server and am encountering many problems. For starters the README.md only references how to install the client library and I guess that when you are trying to install the server you are meant to follow the "for developers" link https://nomad-lab.eu/prod/rae/docs/index.html The documentation there doesn't seem to contain any installation advice until you reach "Developing NOMAD" https://nomad-lab.eu/prod/rae/docs/developers.html That page seems to be out of date since commit 752b5c64ce1f44227500e76703d7ee6a4a5fac0d (Tue Nov 29 16:38:31 2022) since setup.sh got deleted. The requirements.txt also seems to be at least partially broken since scipy==1.7.1 doesn't exist in pip (1.7.2 does though). Building the docker images with docker build . also fails. So before I report bugs on every method I tried of which most aren't probably supported or meant to be used that way I wanted to ask where the documentation for running a nomad server of any kind is located (at this point I don't care if it is docker or through a python venv) before I spam the bug tracker with tickets.

The setup described in https://nomad-lab.eu/prod/v1/test/docs/oasis.html tries at the end do compose up gui which doesn't exist? My main problem is probably that I'm confused by the terminology and don't know where to start. Do I need labs? Oasis? Coe? The container-manager? Should I build it from the nomad-FAIR repo?

markus1978 commented 1 year ago

The main issue that is underpinning all this is the link in the README.md. It is outdated and does not reflect the current develop branch.

The right documentation for the current develop is deployed to our beta installation here: https://nomad-lab.eu/prod/v1/staging/docs/index.html

From here, it depends on what you want to do:

markus1978 commented 1 year ago

Understandably, this is all confusing and not very accessible for outsiders. We are currently building a new project web-site, revised documentation, etc. This will eventually make the terminology and documentation more accessible.

With a few details on what you want to achieve, I can give more help.

BlackLotus commented 1 year ago

Yeah I got oasis up and running now as well (had to pull down my existing containers and do a clean setup, but that worked), but it's only a docker setup. Hoped that I could get it clean up and running without using and most docs seem to be at least partially out of date (like mentioned above the oasis link states at one point to execute docker compose up app worker gui and the gui service is not defined (I guess gui is either app or north?)

Anyway thank you again for your reference links I will try to limit myself to the documentation found under https://nomad-lab.eu/

Edit:

With a few details on what you want to achieve, I can give more help.

I tried to reproduce the docker binaries and/or to do a clean setup of nomad without using docker (or with a minimal docker setup). I wanted to check all dependencies and run the service with the newest libraries possible to offer a (hopefully) secure and up to date instance. Sadly I couldn't get the official docker builds reproduced and couldn't run a dockerless build properly since it was kind of hard to figure out which service depends on which service, in which way and even what services are needed. (I realize my sentences structure is a bit missed up so I will try to rephrase as bullet points)

And yeah like you mentioned it was pretty confusing since I referenced older docs. Anyway thank you for taking the time to answer and I will probably post follow ups while trying to get it running.

mdforti commented 1 year ago

I have a question that might be related to the last comment by blacklotus and this issue. I want to build a docker image with my fork of the nomad repository, but until now i am not successful. My steps:

Appartently .dockerignore is ok so I dont know what else to look at.

markus1978 commented 1 year ago

I am more speculating than knowing. But docker build --pull https://github.com/some/repo might not traditionally clone the project and might not produce a .git folder leading to no .git folder being present in the docker build context?

For context:

mdforti commented 1 year ago

Thank you for the suggestions !

Fortunately I was able to get a successful build with this command:

DOCKER_BUILDKIT=1 docker  build --build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=1 --pull --no-cache --label nomad-mdforti -t check_strucuture_name    https://github.com/mdforti/nomad.git#check_structure_name

apparently docker build removes .git after cloning, and --build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=1 keeps the repo.

Now, the build was successful although the image is not working but I will probably have a better saying after a few tests - also the build process fills my disk and that might be interfering.

mdforti commented 1 year ago

the following setup gave me the expected results:

1) modify the docker-compose.yaml app, worker and north images: replace the image entry by: build : https://github.com/user/repo#branch image: desired_image_name:desired_branch_tag

2) build using docker compose , not docker build: docker compose build --build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=1

this can take a long (~15 min in my laptop) time and requires ~ 15 - 20GB disk space for build caches and image storage. You can clean caches using docker system prune afterwards.

3) execute docker pull and docker up -d to run nomad oasis with modifications.

hope this helps !

markus1978 commented 1 year ago

Thanks a lot @mdforti . I added a section about building the image to the documentation. I included you findings there. It will be available with the next release.

markus1978 commented 1 year ago

I am closing this issue. Numerous actions have been taken (below). This is the best we can do for now to improve the situation.

mdforti commented 1 year ago

I am sorry for comming back to this. the instructions above are misleading. I see now that docker compose pull is not necesary on the context of the local image. so the review:

I have the impression that I am missing something yet, as the rabbit, elastic, and mongo will still need to be pulled?

markus1978 commented 1 year ago

Can you be more specific on what part of the documentation is misleading and what the problem is that you are consequently experiencing? Is this about this part: https://nomad-lab.eu/prod/v1/staging/docs/develop/setup.html#build-the-docker-image?

I am not sure how docker compose build is working. I guess it is only building where the docker-compose.yaml is leading to a source with Dockerfile. This might not include building rabbit, elastic, mongo and they have to be pulled?

mdforti commented 1 year ago

with 'instructions above' I was referring to the instructions in this issue and not the ones in the link you posted.

But, now that you mention, there are also a couple things there.

I see you have examples using my personal fork of the nomad repo. Could you please replace it for a generic one ? this repo is for testing in my institute. I have it open only to testing proposes but I woulnt like others to pull this as it includes institution visuals etc.

Then, after the building with docker directly from command line, it is not clear to me how to modify the docker compose yaml file such that the containers work with the built image. All the steps I posted 'above' ( in this issue) work with docker compose build but not necesarily with docker build.

I will try to prepare a more clear step by step to make the procedure from scratch. A total begginer with docker (like me a few weeks ago) might find that helpful.

markus1978 commented 1 year ago

I see you have examples using my personal fork of the nomad repo. Could you please replace it for a generic one ? this repo is for testing in my institute. I have it open only to testing proposes but I woulnt like others to pull this as it includes institution visuals etc.

Yes of course. That was not intentional. I was to eagerly copy-n-pasting. I remove this asap.

markus1978 commented 1 year ago

Then, after the building with docker directly from command line, it is not clear to me how to modify the docker compose yaml file such that the containers work with the built image. All the steps I posted 'above' ( in this issue) work with docker compose build but not necesarily with docker build.

For us it is a thin line between providing the necessary information (what we need to do) and making a docker/docker-compose tutorial (what we do not want to do). It is a compromise and not alway perfect for everyone.

mdforti commented 1 year ago

I totally understand.

I see you have examples using my personal fork of the nomad repo. Could you please replace it for a generic one ? this repo is for testing in my institute. I have it open only to testing proposes but I woulnt like others to pull this as it includes institution visuals etc.

Yes of course. That was not intentional. I was to eagerly copy-n-pasting. I remove this asap.

I aslo understand, no worries.