Coder Social home page Coder Social logo

HydroShare (hydroshare)

HydroShare is a website and hydrologic information system for sharing hydrologic data and models aimed at giving users the cyberinfrastructure needed to innovate and collaborate in research to solve water problems.

Nightly Build Status generated by Jenkins CI (develop branch)

Workflow Clean Build/Deploy Unit Tests Flake8 Requirements
Build Status Build Status Build Status Build Status Build Status Requirements Status

HydroShare is a website and hydrologic information system for sharing hydrologic data and models aimed at providing the cyberinfrastructure needed to enable innovation and collaboration in research to solve water problems. HydroShare is designed to advance hydrologic science by enabling the scientific community to more easily and freely share products resulting from their research, not just the scientific publication summarizing a study, but also the data and models used to create the scientific publication. With HydroShare users can: (1) share data and models with colleagues; (2) manage who has access to shared content; (3) share, access, visualize and manipulate a broad set of hydrologic data types and models; (4) use the web services API to program automated and client access; (5) publish data and models to meet the requirements of research project data management plans; (6) discover and access data and models published by others; and (7) use web apps to visualize, analyze, and run models on data in HydroShare.

Install

Prerequisites

Supported OS (developer laptops): macOS 10.12+, Win10+ Pro, Ent, Edu, Acad Pro, Acad Ent, CentOS 7 and Ubuntu/Lubuntu 18+ LTS

We got some troubles with Lubuntu 16.04 LTS so probably Ubuntu 16.04 LTS also does not work

Familiarity with docker and git are required to work with HydroShare

Some VM skills such as network settings (Bridge/NAT/Host only) and file sharing are needed if you work with a virtual machine.

For Windows, this link is required to proceed - https://docs.google.com/document/d/1wIQEYq3OkWmzPTHeyGyjXLZWrinEXojJPBTJq7fczL8/edit#heading=h.mfmd8m9mxvsl

One-Time Install

Tables are provided (in Courier font) throughout this wiki for copy-paste of entire blocks.

  1. Open a terminal (macOS, Linux) or command prompt (Windows) Navigate to where you will store the source code, for example /Users/yourname/repo/

Typically you will find it under this directory:

cd ~/repo
  1. Get code

Note it should have a default branch set to the develop branch

git clone https://github.com/hydroshare/hydroshare.git

git checkout <branch>

To get current solr revision fixes:

  a. git pull

cd hydroshare

b. docker exec -u hydro-service -ti hydroshare python manage.py solr_update

It’s very important that please DO NOT change the directory name after cloned. Let it be “hydroshare” If you are running inside a virtual machine such as HydroDev Ubuntu 18.04 from here, you need to:

  1. Log into Docker via application and command line. Command line:

    docker login

    You will be asked to enter your username and password

  2. Launch the stack

     ./local-dev-first-start-only.sh
    

Following the screen instruction to continue.

Run the following command on completion to launch Hydroshare:

docker-compose -f local-dev.yml up 
  1. Sanity Checks

    Some WARNINGs are normal.

    HydroShare is available in your browser at http://localhost or http://localhost:8080 in case you are running inside a VM

    The default admin page is http://localhost/admin

    The default admin account is admin:default

    Swagger API docs http://localhost/hsapi/

  2. Start & Stop & Log

To start HydroShare, only need to open a windows shell, change to HydroShare code directory then run

docker-compose -f local-dev.yml (up | down) [-d] [--build]

Note bracketed -d for daemon is optional and you don’t paste in the brackets

Use -d option in case you want to type new command on this windows or don’t want to see real-time output log.

Use --build option in case docker keeps image in cache and does not update correctly while modifying the Dockerfile and working with PyCharm

CREATE NEW ACCOUNT - This is the same as it's always been in HydroShare. Ask a teammate or hack at it. Basically open a hydroshare console window then use the UI to sign up for a new account and watch the hydroshare container console (docker logs hydroshare) for a verification link and paste that into your browser and save the new account in the UI.

To stop HydroShare, only need to close the running windows or open a new windows then run

docker-compose -f local-dev.yml down

All data is persisted for the next start.

To see the logs in case you start with -d option, open a windows then run

docker-compose -f local-dev.yml logs

Or

docker logs <container name>

Branching When you activate a new branch, just bring the stack down and up again. Sometimes you can get away with a warm restart of the stack or even relying on the Django debug mode (doing nothing but waiting).

Usage

For all intents and purposes, Hydroshare is a large Python/Django application with some extra features and technologies added on:

  • SOLR for searching
  • Redis for caching
  • RabbitMQ for concurrency and serialization
  • iRODS for a federated file system
  • PostgreSQL for the database backend

The hsctl Script

The hsctl script is your primary tool in interacting with and running tasks against your Hydroshare install. It has the syntax ./hsccl [command] where [command] is one of:

  • loaddb: Deletes existing database and reloads the database specified in the hydroshare-config.yaml file.
  • managepy [args]: Executes a python manage.py [args] call on the running hydroshare container.
  • rebuild: Stops, removes and deletes only the hydroshare docker containers and images while retaining the database contents on the subsequent build as defined in the hydroshare-config.yaml file
  • rebuild --db: Fully stops, removes and deletes any prior hydroshare docker containers, images and database contents prior to installing a clean copy of the hydroshare codebase as defined in the hydroshare-config.yaml file.
  • rebuild_index: Rebuilds the solr/haystack index in a non-interactive way.
  • restart: Restarts the django server only.
  • start: Starts all containers as defined in the docker-compose.yml file.
  • stop: Stops all containers as defined in the docker-compose.yml file.
  • update_index: Updates the solr/haystack index in a non-interactive way.

Testing and Debugging

Testing

Tests are run via normal Django tools and conventions. However, you should use the hsctl script mentioned abouve with the managepy command. For example: ./hsctl managepy test hs_core.tests.api.rest.test_resmap --keepdb.

There are currently over 600 tests in the system, so it is highly recommended that you run the test suites separately from one another.

Debugging

You can debug via PyCharm by following the instructions here.

Other Configuration Options

Local iRODS

Local iRODS is not required for development unless you are specifically working on the iRODS integration. However,if you want to work with iRODS or you simply want to learn about it, you can enable it locally.

Contribute

There are many ways to contribute to Hydroshare. Review Contributing guidelines and github practices for information on

  1. Opening issues for any bugs you find or suggestions you may have
  2. Developing code to contribute to HydroShare
  3. Developing a HydroShare App
  4. Submiting pull requests with code changes for review

License

Hydroshare is released under the BSD 3-Clause License. This means that you can do what you want, so long as you don't mess with the trademark, and as long as you keep the license with the source code.

©2017 CUAHSI. This material is based upon work supported by the National Science Foundation (NSF) under awards 1148453 and 1148090. Any opinions, findings, conclusions, or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the NSF.

HydroShare's Projects

auth_microservice icon auth_microservice

Microservice which abstracts out OAuth2/OpenID exchanges and token management from applications

cybertraining icon cybertraining

Data Streams, Model Workflows, and Educational Pipelines: using cyberinfrastructure to address challenges in water research training, education and workforce development

czo2hs icon czo2hs

Migration script for criticalzone.org to HydroShare

docker-elk icon docker-elk

The Elastic stack (ELK) powered by Docker and Compose.

documentation icon documentation

HydroShare documentation - prior wiki contents, files, etc.

hs-irods icon hs-irods

iRODS images on HydroShare Develop environment for HS developer

hs-solr icon hs-solr

SOLR images on HydroShare Develop environment for HS developer

hs_core icon hs_core

Hydroshare Core resources and functionality

hs_netcdf_to_hyrax icon hs_netcdf_to_hyrax

The script that copies public netCDF resources or composite resources with netCDF file type on demand to hyrax server

hs_party icon hs_party

A simplified organization-person model separate from django system.

hs_postgis icon hs_postgis

A Hydroshare database container based on official images

hsclient icon hsclient

A python client for interacting with HydroShare in an object oriented way.

hsmodels icon hsmodels

pydantic models for hydroshare metadata

hsrules icon hsrules

iRODS Python rulesbase for Hydroshare

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.