FAIRmat-NFDI / nomad-plugin-template

A template repository for creating a repository with a NOMAD plugin package.
Apache License 2.0
4 stars 2 forks source link

Installation of Plugin for NOMAD OASIS #6

Open NiclRich opened 2 months ago

NiclRich commented 2 months ago

Hi everyone,

I try to install a plugin for Nomad OASIS, which is installed on my local machine. I use instructions described under Option 2 from here

I had to adjust the Dockerfile in order to let Docker to find the source code for the build and then I received the following error message:

[+] Building 9.6s (8/9)                                          docker:default
 => [internal] load build definition from Dockerfile                       0.0s
 => => transferring dockerfile: 322B                                       0.0s
 => [internal] load metadata for gitlab-registry.mpcdf.mpg.de/nomad-lab/n  0.0s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => [1/5] FROM gitlab-registry.mpcdf.mpg.de/nomad-lab/nomad-fair:latest    0.0s
 => [internal] load build context                                          0.0s
 => => transferring context: 3.64kB                                        0.0s
 => CACHED [2/5] RUN pip install build                                     0.0s
 => CACHED [3/5] COPY     src/nomad_greenlightparser     tests     README  0.0s
 => ERROR [4/5] RUN python -m build --sdist                                9.5s
------                                                                          
 > [4/5] RUN python -m build --sdist:                                           
0.757 * Creating isolated environment: venv+pip...                              
0.769 * Installing packages in isolated environment:                            
7.017   - setuptools-scm>=8.0                                                   
7.017   - setuptools>=61.0.0                                                    
7.017 * Getting build dependencies for sdist...
9.311 running egg_info
9.311 error: error in 'egg_base' option: 'src' does not exist or is not a directory
9.398 
9.398 ERROR Backend subprocess exited when trying to invoke get_requires_for_build_sdist
------
Dockerfile:13
--------------------
  11 |         .
  12 |     
  13 | >>> RUN python -m build --sdist
  14 |     
  15 |     RUN pip install dist/nomad-schema-plugin-example-*.tar.gz
--------------------
ERROR: failed to solve: process "/bin/sh -c python -m build --sdist" did not complete successfully: exit code: 1

My dockerfile:

FROM gitlab-registry.mpcdf.mpg.de/nomad-lab/nomad-fair:latest

RUN pip install build

COPY \
    src/nomad_greenlightparser \
    tests \
    README.md \
    LICENSE \
    pyproject.toml \
    .

RUN python -m build --sdist

RUN pip install dist/nomad-schema-plugin-example-*.tar.gz

I run Nomad OASIS using the docker image downloaded from the Website on my Linux machine (POP! OS). Therefore I just can't build the package directly (that works) and install it via pip, since it uses another Python environment. So how do I install a Plugin originated from this template?

blueraft commented 2 months ago

The docs are unfortunately a bit out of date, can you try some of the methods described here

NiclRich commented 2 months ago

Your proposed solution works for the command line tool, but I how do I install the plugin such that it can be seen in the GUI of NOMAD OASIS?