Middleware for Assisting the Registration of Samples (MARS) is a project of Working Group 4 of the Internet of Samples (iSamples) NSF-funded Research Coordination Network (RCN). MARS is being developed to explore the automation of registering legacy samples at SESAR (System for Earth Sample Registration) with pertinent metadata and a IGSN (International GeoSample Number). The initial targeted repository is the cores collection of the Scripps Institution of Oceanography. MARS has not been released for commercial release yet and the current prototype uses SESAR’s test database, but Mac and Linux users may demo the application by following the instructions for setting up the development environment.
Running MARS on Mac or Linux
Before installing Mars, you must have npm (Node Package Manager) and git. npm is used for managing dependencies for MARs. If you do not have Node.js and npm on your computer you will need to install Node and npm comes installed with it. Follow the instructions to download Node.js (Note: The MARs demo only works for MAC and Linux users right now)
You will also need to install git if you have not done so already and follow the step by step directions to install git on your Mac.
To set up MARS for developing on a Mac or Linux computer, please follow these instructions for the development environment. Since the project uses React and Redux, I suggest downloading the React and Redux Add-on developer tools through the Chrome browser, but they are not necessary for development.
If you do not have the MARS repository setup on your local machine, you will need to follow the instructions below. Otherwise, fetch any new code from the upstream with:
git fetch upstream master
To set up your MARS repository, navigate to the MARS github page and you will want to fork the project into your repositories by pushing the “Fork” button. In your terminal, you will need to enter the command (where YOURUSERNAME is replaced with your github username):
git clone https://github.com/YOURUSERNAME/MARS.git
This will create a new folder in your current directory with the name “MARS” and initialize the repository.
Now you want to install the dependencies for MARS. You will need to be in the /mars directory. You can change directories by running the following command in the terminal:
Now install the dependencies by running this command in the terminal:
To open MARS, run this next command which will open the native application in Electron:
npm run start-dev-watch
Electron will open, and you should be able to see the MARS application. If you don’t see the MARS homepage, you may need to wait a couple of minutes for the app to build, and then you can press command+R (for MAC) on electron to refresh the browser.
Note: MARS is currently in the development stage, so MARS uses SESAR’s test database and there may be developer tools visible to you.
If the electron application does not open at all, make sure you are in the MARS directory and that you have followed all of the directions for setting up MARS
If the electron application opens but nothing shows up in the window, you will need to make sure that nothing is running in your port 8080. Open your command terminal and type the following command:
lsof -n -i4TCP:8080
If anything is returned, then you need to end the program that is running on that port. You may kill the program with the following command:
kill -9 PID
where PID is the number returned in the terminal after the previous command.
A Simple Tutorial
Navigate to the Mapping tab to prepare the samples to be uploaded. The Scripps mapping file can be found in the file path MARS/user/scrippsMap.js. The file format is CSV for all files. MARS currently services the cores collection at the Scripps Institution of Oceanography, and so some sample data for testing can be downloaded from the Github page. Select the file(s) for the data and after all the fields are filled in, click the Proceed button.
The samples page will display past uploads and the user’s examples. This page is underconstruction.
Uploading to SESAR
After setting up the mapping, all of the samples will be listed in the window with pertinent metadata. Click the Upload button in the top right corner, and the samples will be uploaded to SESAR’s test database. If the upload is successful, a new field called IGSN will pop up for each of the samples in MARS. If you want to verify that the samples uploaded, you can view your samples by logging in to SESAR.