Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • metobs/MetObsSite
  • wroberts/MetObsSite
  • davidh/MetObsSite
3 results
Show changes
Commits on Source (44)
Showing
with 6887 additions and 6868 deletions
......@@ -54,6 +54,9 @@ After following GitLab instructions for registering a new GitLab runner, we
need to do some extra setup to prepare the runner's account. See the
`.gitlab-ci.yml` file for the exact commands that are run for each job.
At the time of writing a runner is registered on the `rain03` server with a
"shell" executor with everything running under the gitlab-runner user account.
### Add conda to the runner's environment
The GitLab CI configuration expects the runner to know what the "conda"
......@@ -61,7 +64,7 @@ command is. To enable this we run a onetime command on the runner which
initializes a bashrc for the `gitlab-runner` user.
```bash
sudo -u gitlab-runner /home/davidh/miniconda3/bin/conda init bash
sudo -u gitlab-runner /opt/miniforge3_YYYYMMDD/condabin/conda init bash
```
Or where ever conda is installed for this system. This will create a bashrc
......@@ -71,10 +74,11 @@ is used in the `.gitlab-ci.yml` scripts for creating a build environment.
### GitLab Runner Upload
The uploading of the generated website content is done with rsync via SSH.
This currently uses two SSH keys under David Hoese's user account (davidh)
on the `webaccess` server. These keys are restricted to only run the specific
rsync commands used by gitlab-ci. This is configured in the
`~/.ssh/authorized_keys` file:
This currently uses two SSH keys defined in the GitLab CI Variables (via
the web GUI). These are configured under David Hoese's user account (davidh)
on the `webaccess` server in `~/.ssh/authorized_keys`. These keys are
restricted to only run the specific
rsync commands used by gitlab-ci.
```bash
command="rsync --server -vulogDtpre.iLsfxC --delete . METOBS_TEST",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa <key> metobs-test upload key
......
......@@ -7,8 +7,10 @@ os_kind=$(awk -F= '/^ID=/{print $2}' /etc/os-release)
os_kind=${os_kind//\"/}
if [[ "${os_kind}" == "ubuntu" ]]; then
source /var/lib/gitlab-runner/.bashrc
elif [[ "${os_kind}" == "centos" ]]; then
source ~/.bashrc
elif [[ "${os_kind}" == "pop" ]]; then
source /var/lib/gitlab-runner/.bashrc
else
source ${HOME}/.bashrc
fi
if [[ -z "$METOBS_SITE_DEST" ]]; then
......@@ -20,8 +22,10 @@ if [[ -z "$METOBS_SITE_DEST" ]]; then
fi
# create or update the existing environment to the newest pelican version
conda env update -p "${PWD}/rain_site_env" -f "${SCRIPT_DIR}/build_environment.yml"
conda activate "${PWD}/rain_site_env"
# Environments should be created as gitlab-runner user and placed in
# /home/gitlab-runner/.conda/envs/<env name> by default
conda env update -n "rain_site_env" -f "${SCRIPT_DIR}/build_environment.yml"
conda activate "rain_site_env"
make clean
make publish
echo $PWD
<?xml version="1.0" encoding="UTF-8"?>
<playlist version="1" xmlns="http://xspf.org/ns/0/" xmlns:vlc="http://www.videolan.org/vlc/playlist/ns/0/">
<title>Playlist</title>
<trackList>
<track>
<location>rtp://@233.0.59.107:5678</location>
<extension application="http://www.videolan.org/vlc/playlist/0">
<vlc:id>0</vlc:id>
</extension>
</track>
</trackList>
<extension application="http://www.videolan.org/vlc/playlist/0">
<vlc:item tid="0" />
</extension>
</playlist>
<?xml version="1.0" encoding="UTF-8"?>
<playlist version="1" xmlns="http://xspf.org/ns/0/" xmlns:vlc="http://www.videolan.org/vlc/playlist/ns/0/">
<title>Playlist</title>
<trackList>
<track>
<location>rtp://@233.0.59.107:2345</location>
<extension application="http://www.videolan.org/vlc/playlist/0">
<vlc:id>0</vlc:id>
</extension>
</track>
</trackList>
<extension application="http://www.videolan.org/vlc/playlist/0">
<vlc:item tid="0" />
</extension>
</playlist>
<?xml version="1.0" encoding="UTF-8"?>
<playlist version="1" xmlns="http://xspf.org/ns/0/" xmlns:vlc="http://www.videolan.org/vlc/playlist/ns/0/">
<title>Playlist</title>
<trackList>
<track>
<location>rtp://@233.0.59.107:3456</location>
<extension application="http://www.videolan.org/vlc/playlist/0">
<vlc:id>0</vlc:id>
</extension>
</track>
</trackList>
<extension application="http://www.videolan.org/vlc/playlist/0">
<vlc:item tid="0" />
</extension>
</playlist>
<?xml version="1.0" encoding="UTF-8"?>
<playlist version="1" xmlns="http://xspf.org/ns/0/" xmlns:vlc="http://www.videolan.org/vlc/playlist/ns/0/">
<title>Playlist</title>
<trackList>
<track>
<location>rtp://@233.0.59.107:6789</location>
<extension application="http://www.videolan.org/vlc/playlist/0">
<vlc:id>0</vlc:id>
</extension>
</track>
</trackList>
<extension application="http://www.videolan.org/vlc/playlist/0">
<vlc:item tid="0" />
</extension>
</playlist>
<?xml version="1.0" encoding="UTF-8"?>
<playlist version="1" xmlns="http://xspf.org/ns/0/" xmlns:vlc="http://www.videolan.org/vlc/playlist/ns/0/">
<title>Playlist</title>
<trackList>
<track>
<location>rtp://@233.0.59.107:1234</location>
<extension application="http://www.videolan.org/vlc/playlist/0">
<vlc:id>0</vlc:id>
</extension>
</track>
</trackList>
<extension application="http://www.videolan.org/vlc/playlist/0">
<vlc:item tid="0" />
</extension>
</playlist>
......@@ -37,10 +37,15 @@ var DATA_API_INFO= {
'8.0m','9.0m','10.0m','11.0m','12.0m','13.0m','14.0m','15.0m',
'16.0m','17.0m','18.0m','19.0m','20.0m']
},
"doptoppm":{"display_name":"Dissolved Oxygen Concentration"},
"doptosat":{"display_name":"Dissolved Oxygen Saturation"},
"chlorophyll":{"display_name":"Chlorophyll"},
"phycocyanin":{"display_name":"Phycocyanin"}
"spcond":{"display_name":"Specific conductivity of the water (2019-present)"},
"do_raw2":{"display_name":"Dissolved Oxygen Concentration (2019-present)"},
"do_sat2":{"display_name":"Dissolved Oxygen Saturation (2019-present)"},
"chlorophyll_ysi":{"display_name":"Chlorophyll (2019-present)"},
"phycocyanin_ysi":{"display_name":"Phycocyanin (2019-present)"},
"doptoppm":{"display_name":"Dissolved Oxygen Concentration (pre-2019)"},
"doptosat":{"display_name":"Dissolved Oxygen Saturation (pre-2019)"},
"chlorophyll":{"display_name":"Chlorophyll (pre-2019)"},
"phycocyanin":{"display_name":"Phycocyanin (pre-2019)"}
}
}
}
......
......@@ -319,9 +319,12 @@ $(document).ready(function(){
changeYear: true,
dateFormat:'yy-mm-dd',
timeFormat:'HH:mm',
showTimezone:true,
timezoneList:[{label: "UTC", value: 0}],
timezone:0,
showSecond:false,
showMillisec:false,
showMicrosec:false
showMicrosec:false,
});
$('#End-date-picker').datetimepicker({
......@@ -329,9 +332,12 @@ $(document).ready(function(){
changeYear: true,
dateFormat:'yy-mm-dd',
timeFormat:'HH:mm',
showTimezone:true,
timezoneList:[{label: "UTC", value: 0}],
timezone:0,
showSecond:false,
showMillisec:false,
showMicrosec:false
showMicrosec:false,
});
//bind the enabling/disabling of forms to radio buttons
......
{
"ignore": [
"node_modules/*"
]
}
> 0.25%
not dead
\ No newline at end of file
{
"presets": [
[
"@babel/preset-env",
{
"useBuiltIns": "entry",
"corejs": "3.22"
}
]
]
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
......@@ -5,32 +5,31 @@
"main": "tower/API.js",
"dependencies": {
"event-emitter": "^0.3.5",
"flux": "^3.1.3",
"html2canvas": "^1.0.0-rc.3",
"jquery": "^3.4.0",
"flux": "^4.0.4",
"html2canvas": "^1.4.1",
"jquery": "^3.7.1",
"jquery-timepicker": "^1.3.3",
"react": "^16.8.6",
"underscore": "^1.9.1"
"node": "^23.11.0",
"react": "^16.14.0",
"underscore": "^1.13.7"
},
"devDependencies": {
"@babel/core": "^7.4.3",
"@babel/preset-env": "^7.4.3",
"babel-core": "^6.26.3",
"babel-loader": "^7.1.5",
"babel-preset-es2015": "^6.24.1",
"jsdoc": "^3.6.3",
"@babel/core": "^7.26.10",
"@babel/preset-env": "^7.26.9",
"babel-loader": "^10.0.0",
"jsdoc": "^4.0.4",
"npm-run-all": "^4.1.5",
"npm-watch": "^0.6.0",
"raw-loader": "^2.0.0",
"rimraf": "^2.6.3",
"npm-watch": "^0.13.0",
"raw-loader": "^4.0.2",
"rimraf": "^5.0.10",
"source-map-loader": "^0.2.4",
"uglifyjs-webpack-plugin": "^2.1.2",
"webpack": "^4.30.0",
"webpack-cli": "^3.3.0"
"terser-webpack-plugin": "^5.3.14",
"webpack": "^5.99.6",
"webpack-cli": "^6.0.1"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"babel": "babel --ignore 'node_modules/*' --presets es2015 controller.js -o build/main.bundle.js",
"babel": "babel --ignore 'node_modules/*' --presets env controller.js -o build/main.bundle.js",
"start": "http-server",
"webpack": "webpack",
"watch": "npm-run-all -p watch:*",
......
......@@ -128,6 +128,10 @@ function requestPlotUpdate(dataCache, div, plotsInfo, startTime, endTime, interv
interval = '1m';
// hours, minutes, seconds
time_parts = _.map(startTime.split(':'), Number);
if (update) {
// if we're updating then we don't need to get a ton of data every time
startTime = "-00:05:00";
}
dt_in_ms = -1000 * 60 * 60 * time_parts[0] + 1000 * 60 * time_parts[1] + 1000 * time_parts[2];
for (var i in intervalLookUp) {
if (dt_in_ms >= intervalLookUp[i][0]) {
......
......@@ -9,7 +9,7 @@ var utils = require('./utils.js');
*/
function initTable(div_id, plotOrder, plotsInfo) {
var div = $('#'+div_id);
var table = $('<table class="met_table"><tbody></tbody></table>');
var table = $('<table class="met_table text-left" align="center"><tbody></tbody></table>');
var tbody = table.children('tbody');
var plot_info;
......@@ -41,9 +41,9 @@ function initTable(div_id, plotOrder, plotsInfo) {
}
};
}
div.append('<h3>'+plotsInfo.title+'</h3>');
div.append('<h3 style="text-align:center">'+plotsInfo.title+'</h3>');
div.append(table);
div.append('<span id="timestamp"></span>');
div.append('<span id="timestamp" style="text-align:center"></span>');
};
function add_anc_rows(tbody,plot_key,idx,trace_info){
......@@ -153,6 +153,7 @@ function updateTable(dataObj,plotsInfo) {
if (trace_info.type=='contour') {
td_idx=update_contour_cells(data,data_cells,convert_cells,trace_info,td_idx);
} else {
ticktext.preConvertValue(data[trace_info['var_names'][0]], plot_info.yaxis);
var update_val = data[trace_info['var_names'][0]][0];
if(update_val || update_val==0){
var units = plot_info.yaxis.units;
......
......@@ -42,6 +42,10 @@ function getSpeedMPH(val) {
// convert m/s to mph
return val * 3600 / 1608;
}
function getSpeedKnotsToMPH(val) {
// convert knots to mph
return val * 1.15078;
}
function getSpeedKTS(val) {
//m/s to knots
return val * 1.94384;
......@@ -58,10 +62,16 @@ function getAccumMillimeter(val) {
// convert inches to millimeters
return val * 25.4;
}
function getAccumMillimeterToInches(val) {
// convert millimeters to inches
return val / 25.4;
}
function cardinalWDir(degrees){
if (isNaN(degrees)) {
return "N/A";
}
return ['N','NNE','NE','ENE',
'E','ESE','SE','SSE',
'S','SSW','SW','WSW',
......@@ -83,7 +93,9 @@ var CONVERSION_FUNCTIONS = {
getF: getF,
getPresInHg: getPresInHg,
getSpeedMPH: getSpeedMPH,
getSpeedKnotsToMPH: getSpeedKnotsToMPH,
getAccumMillimeter: getAccumMillimeter,
getAccumMillimeterToInches: getAccumMillimeterToInches,
cardinalWDir: cardinalWDir,
getSpeedKTS:getSpeedKTS
};
......@@ -197,9 +209,26 @@ function getTickVals(min, max, bump) {
}
function preConvertValue(values, axis_info) {
/**
* Convert values before inserting them into the final storage array.
*/
if (!('preconvert_value' in axis_info)) {
return;
}
var val;
for (var i=0; i < values.length; i++) {
val = CONVERSION_FUNCTIONS[axis_info.preconvert_value](values[i]);
val = (val.toFixed)?val.toFixed(axis_info.precision):val;
values[i] = val;
}
}
module.exports.getTickVals = getTickVals;
module.exports.getProbeText = getProbeText;
module.exports.getTickText = getTickText;
module.exports.preConvertValue = preConvertValue;
......
......@@ -246,12 +246,14 @@ function replaceData(dataCache, graphDiv, plotsInfo, dataObj, update, maxPoints)
tracesToExtend.push(traceIndex + index);
// scatter plots, assume the y data is the data being updated
_.each(traceInfo.var_names, function (var_name) {
// push the entire new data array as one element to update
ticktext.preConvertValue(dataObj[var_name], plotInfo.yaxis);
extendData.y.push(dataObj[var_name]);
if (plotsInfo['isLobbyDisplay']) {
axis_number = i == 0 ? '': i + 1;
fitGraphs(dataCache[i], dataObj[var_name], var_name, layoutUpdates, 'yaxis' + axis_number, plotInfo['yaxis2']['tickvals'])
}
// push the entire new data array as one element to update
extendData.y.push(dataObj[var_name]);
// Get new probe text shown when hovering over the traces
if ('probe_text' in traceInfo && traceInfo['probe_text'] === null) {
......