

#Barebones.map modtools install#
RUN pip3 install -user -r requirements.txt # install packages as normal user (app, provided by passenger) RUN pip3 install -U 'pip>=10' setuptools wheel # Run this as sudo to replace the version of pip requirements.txt /home/app/code/requirements.txt FROM materialscloud/tools-barebone:X.Y.ZĬOPY. The commands that you need and that are specific to custom-tool can be added at the bottom of the file. You can create such a file inside custom-tool/Dockerfile. To build and run the docker container for custom-tool.ĭockerfile file that achieves this goal. Once the files are ready, we can write a Dockerfile that extends the tools-barebone image (with the tag you have chosen earlier), # Add here more sections to the accordion shown on the top of the selection page Upload_structure_additional_content: "upload_structure_additional_content.html" # if the upload structure block is present, you can add additional content right above the 'submit' button, if you want (e.g. Select_content: "visualizer_select_example.html" # what to show in the selection page (below the upload structure block, if present) # All the remaining ones, if any, are shown afterwards in a default order. Those from the list will be shown first (NOTE! if the name is unknown, it is ignored). # If you have an upload block and want to have some parsers first, you can specify their internal # `/compute/process_structure/` to process the results # In this case, you will have to provide an endpoint # If True, a structure selection block will be shown and it will provide a common set of parsers. Here below: window_title: "Materials Cloud Tools: an example app"Ībout_section_title: "About this new tool" That will be shown in the section about the tool, for tool citation text and for the acknowledgements.Īs an example of the most common variables to be set in the config.yaml file, we provide here an example
#Barebones.map modtools update#
Update the config.yaml file and add HTML templates The config.yaml file contains the configuration details used in this new tool like window title, Touch additional_content.html # additional functionality if any, otherwise empty file Touch how_to_cite.html # add tool citation here Touch about.html # add information about this tool here Touch ack.html # add acknowledgement text here # create the folder in which you will put the

Let us first create the minimum set of files required

To write the new tool called custom-tool, create a new directory custom-tool. if your editor has inspection capabilities and needs to see the package, or if you are using a linter. This is not technically required, but it is useful e.g. If you want, you can also install the tools-barebone package (use the same version as the one you picked above) using pip install tools-barebone=X.Y.Z You should see a website similar to the image on the left above. by running docker run -p 8090:80 materialscloud/tools-barebone:latestĪnd then connecting to with your browser. You can try to see if everything works by running a container from this image, e.g. Then, run the following command to get the image: docker pull materialscloud/tools-barebone You can also use the latest tag, but we strongly suggest that you use a pinned version, rather than latest: this will ensure that your tool will continue to work also if future, incompatible versions are released. Get the most recent tools-barebone docker image from DockerHubīrowse to the Tags page on DockerHub for materialscloud/tools-barebone and find the most recent tagged version (in the form X.Y.Z, e.g. On the left side of the figure below) can be extended to develop a new tool called custom-tool Here we briefly explain how the tools-barebone template (shown The tools-barebone framework provides basic templates, that can be extended to develop Scripts to deploy the tool in a docker container.Common widgets, e.g., file upload functionality for crystal structures.A common layout used for every tool in Materials cloud.It can be used as a starting point to develop new tools for the Implemented in Python using Flask Jinja2 templates. Tools-barebone is a framework to develop and deploy small web applications,
