Skip to content

Commit

Permalink
Release chiba-02 (arras-energy#1298)
Browse files Browse the repository at this point in the history
- Fixed help script for subcommands and tools
- Update CYME converter to resolve new issues (arras-energy#1299)
- Fix diesel torque unit (arras-energy#1301)
- Fix metar2glm (arras-energy#1302)

Signed-off-by: David P. Chassin <dchassin@slac.stanford.edu>
  • Loading branch information
dchassin committed Jul 3, 2023
1 parent 0eade30 commit ddf819e
Show file tree
Hide file tree
Showing 64 changed files with 4,508 additions and 2,362 deletions.
75 changes: 51 additions & 24 deletions .github/workflows/develop-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,12 +208,22 @@ jobs:

runs-on: ubuntu-latest
environment: Integration
needs: buildAWSUbuntuAMI
needs: buildUbuntu22FastS3

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Run CF invalidation
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.DEV_CF_ID }} --paths '/*'

- name: Login to DockerHub
uses: docker/login-action@v1
with:
Expand All @@ -226,7 +236,7 @@ jobs:
context: .
file: ./docker/packer/Dockerfile.dev.ul
push: true
tags: hipas/gridlabd:develop
tags: lfenergy/arras:develop

updateS3websites:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -260,27 +270,44 @@ jobs:
- name: Run CF invalidation
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.DEV_CF_ID }} --paths '/*'

- name: Install dependencies and package Lambda function
run: |
pip install -r ./cloud/websites/version.gridlabd.us/lambda/requirements.txt -t ./cloud/websites/version.gridlabd.us/lambda/package
cd ./cloud/websites/version.gridlabd.us/lambda/package
zip -r ../lambda.zip .
cd ..
zip -r lambda.zip app.py
versionUpdate:

- name: Update Lambda image version_handler
run: |
aws lambda update-function-code --function-name version_handler --zip-file fileb://$(pwd)/cloud/websites/version.gridlabd.us/lambda/lambda.zip
- name: Update Lambda image update_latest
run: |
aws lambda update-function-code --function-name update_latest --zip-file fileb://$(pwd)/cloud/websites/version.gridlabd.us/lambda/lambda.zip
runs-on: ubuntu-latest
environment: Integration
needs: buildAWSUbuntuAMI

- name: Make POST request to version.gridlabd.us/update
run: |
version=$(./build-aux/version.sh --version)
build=$(./build-aux/version.sh --number)
branch=$(./build-aux/version.sh --branch)
curl -f -X POST "https://version.gridlabd.us/update_latest" \
-H "Content-Type: application/json" \
-d "{\"version\": \"$version\", \"build\": \"$build\", \"branch\": \"$branch\", \"sk\": \"${{ secrets.DEVELOPSK }}\"}"
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Install dependencies and package Lambda function
run: |
pip install -r ./cloud/websites/version.gridlabd.us/lambda/requirements.txt -t ./cloud/websites/version.gridlabd.us/lambda/package
cd ./cloud/websites/version.gridlabd.us/lambda/package
zip -r ../lambda.zip .
cd ..
zip -r lambda.zip app.py
- name: Update Lambda image version_handler
run: |
aws lambda update-function-code --function-name version_handler --zip-file fileb://$(pwd)/cloud/websites/version.gridlabd.us/lambda/lambda.zip
- name: Update Lambda image update_latest
run: |
aws lambda update-function-code --function-name update_latest --zip-file fileb://$(pwd)/cloud/websites/version.gridlabd.us/lambda/lambda.zip
- name: Make POST request to version.gridlabd.us/update
run: |
version=$(./build-aux/version.sh --version)
build=$(./build-aux/version.sh --number)
branch=$(./build-aux/version.sh --branch)
curl -f -X POST "https://version.gridlabd.us/update_latest" \
-H "Content-Type: application/json" \
-d "{\"version\": \"$version\", \"build\": \"$build\", \"branch\": \"$branch\", \"sk\": \"${{ secrets.DEVELOPSK }}\"}"
75 changes: 51 additions & 24 deletions .github/workflows/master-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,22 @@ jobs:

runs-on: ubuntu-latest
environment: Integration
needs: buildAWSUbuntuAMI
needs: buildUbuntu22FastS3

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Run CF invalidation
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.PROD_CF_ID }} --paths '/*'

- name: Set output
run: |
echo "VERSION=$(./build-aux/version.sh --version)" >> $GITHUB_ENV
Expand All @@ -204,7 +214,7 @@ jobs:
context: .
file: ./docker/packer/Dockerfile.prod.ul
push: true
tags: hipas/gridlabd:latest, hipas/gridlabd:${{ env.VERSION }}
tags: lfenergy/arras:latest, lfenergy/arras:${{ env.VERSION }}

updateS3websites:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -238,27 +248,44 @@ jobs:
- name: Run CF invalidation
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.PROD_CF_ID }} --paths '/*'

- name: Install dependencies and package Lambda function
run: |
pip install -r ./cloud/websites/version.gridlabd.us/lambda/requirements.txt -t ./cloud/websites/version.gridlabd.us/lambda/package
cd ./cloud/websites/version.gridlabd.us/lambda/package
zip -r ../lambda.zip .
cd ..
zip -r lambda.zip app.py
versionUpdate:

- name: Update Lambda image version_handler
run: |
aws lambda update-function-code --function-name version_handler --zip-file fileb://$(pwd)/cloud/websites/version.gridlabd.us/lambda/lambda.zip
- name: Update Lambda image update_latest
run: |
aws lambda update-function-code --function-name update_latest --zip-file fileb://$(pwd)/cloud/websites/version.gridlabd.us/lambda/lambda.zip
runs-on: ubuntu-latest
environment: Integration
needs: buildAWSUbuntuAMI

- name: Make POST request to version.gridlabd.us/update
run: |
version=$(./build-aux/version.sh --version)
build=$(./build-aux/version.sh --number)
branch=$(./build-aux/version.sh --branch)
curl -f -X POST "https://version.gridlabd.us/update_latest" \
-H "Content-Type: application/json" \
-d "{\"version\": \"$version\", \"build\": \"$build\", \"branch\": \"$branch\", \"sk\": \"${{ secrets.MASTERSK }}\"}"
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Install dependencies and package Lambda function
run: |
pip install -r ./cloud/websites/version.gridlabd.us/lambda/requirements.txt -t ./cloud/websites/version.gridlabd.us/lambda/package
cd ./cloud/websites/version.gridlabd.us/lambda/package
zip -r ../lambda.zip .
cd ..
zip -r lambda.zip app.py
- name: Update Lambda image version_handler
run: |
aws lambda update-function-code --function-name version_handler --zip-file fileb://$(pwd)/cloud/websites/version.gridlabd.us/lambda/lambda.zip
- name: Update Lambda image update_latest
run: |
aws lambda update-function-code --function-name update_latest --zip-file fileb://$(pwd)/cloud/websites/version.gridlabd.us/lambda/lambda.zip
- name: Make POST request to version.gridlabd.us/update
run: |
version=$(./build-aux/version.sh --version)
build=$(./build-aux/version.sh --number)
branch=$(./build-aux/version.sh --branch)
curl -f -X POST "https://version.gridlabd.us/update_latest" \
-H "Content-Type: application/json" \
-d "{\"version\": \"$version\", \"build\": \"$build\", \"branch\": \"$branch\", \"sk\": \"${{ secrets.MASTERSK }}\"}"
151 changes: 151 additions & 0 deletions cloud/websites/docs.gridlabd.us/_config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
// config.js
// Copyright (C) 2019 Regents of the Leland Stanford Junior University
//
// This module set the document specifications `host`, `owner`, `project`, `branch`, and `doc`
// as given by the URL, or if absent, as given by the current defaults
//
var package = "Docs-Browser";
var version = "0.1";
var branch = "prototype";
var logorepo = "https://raw.githubusercontent.com/slacgismo/docs-browser/" + branch + "/src/"
var doelogo = logorepo + "doe-logo.png"
var sulogo = logorepo + "stanford-logo.png";
var slaclogo = logorepo + "slac-logo.png";
var gismologo = logorepo + "gismo-logo.png";
var icon = logorepo + "icon.png";
var source = "https://github.com/slacgismo/docs-browser/tree/" + branch + "";
var website = "http://www.slacgismo.org/";
var banner = '<TABLE WIDTH="100%" CELLPADDING=0 CELLSPACING=0 BORDER=0><TR><TD VALIGN="bottom" ALIGN="left"><A HREF="' + source + '" TARGET="_blank"><TABLE><TR><TD><IMG HEIGHT=' + top_panel_height + ' SRC="' + icon + '" />&nbsp;</TD><TD ALIGN="left" VALIGN="middle"><B>' + package + '</B><BR/>Version ' + version + ' by SLAC GISMo</TD></TR></TABLE></A></TD><TD ALIGN="right" VALIGN="middle">'
+ '<A HREF="https://www.energy.gov/science-innovation/electric-power" TARGET="_blank"><IMG HEIGHT=' + top_panel_height + ' SRC="' + doelogo + '" /></A>&nbsp;'
+ '<A HREF="https://www.stanford.edu/" TARGET="_blank"><IMG HEIGHT=' + top_panel_height + ' SRC="' + sulogo + '" /></A>&nbsp;'
+ '<A HREF="https://slac.stanford.edu/" TARGET="_blank"><IMG HEIGHT=' + top_panel_height + ' SRC="' + slaclogo + '" /></A>&nbsp;'
+ '<A HREF="' + website + '" TARGET="_blank"><IMG HEIGHT=' + top_panel_height + ' SRC="' + gismologo + '" /></A>'
+ '</TD></TR></TABLE>';
var year = (new Date()).getFullYear();
if ( year > 2019 )
{
year = "2019-" + year;
}
var copyright = '<A HREF="https://raw.githubusercontent.com/slacgismo/docs-browser/master/LICENSE" TARGET="_blank">Copyright (C) ' + year + ', Regents of the Leland Stanford Junior University</A>';
var query = new URLSearchParams(window.location.search);

function set_default(name, value)
{
// console.info("set_default('" + name + "',value='" + value + "') --> cookie = '" + document.cookie + "'");
if ( document.cookie.indexOf("BLOCKED=") >= 0 )
{
return;
}
if ( value == null )
{
document.cookie = name + "=;";
}
else
{
document.cookie = name + "=" + value + ";path=/; expires=36524";
}
}

function get_default(name,deflt,asnull)
{
// console.info("get_default('" + name + "',value='" + deflt + "')...");
var value = query.get(name);
var type = 'query';
if ( value == null )
{
var ca = document.cookie.split(';');
// console.info(" cookie = " + ca);
for ( var i = 0 ; i < ca.length ; i++ )
{
var c = ca[i].trim();
if ( c.indexOf(name+'=') == 0 )
{
value = c.substring(c.indexOf('=')+1, c.length);
type = 'cookie';
}
}
if ( value == null )
{
value = deflt;
type = 'default';
}
}
if ( asnull != null && value === asnull )
{
value = null;
type += ' asnull'
}
// console.info(" " + type + " --> " + name + " = '" + deflt + "'");
return value;
}

var host = get_default('host',default_host,null);
var owner = get_default('owner',default_owner,null);
var project = get_default('project',default_project,null);
var branch = get_default('branch',default_branch,null);
var doc = get_default('doc',default_doc,null);
var folder = get_default('folder',"",null);
var github_authorization_token = get_default('token',null,'');
var search_keyword = get_default('search',"",null);

function save_defaults()
{
set_default("host",host)
set_default("owner",owner);
set_default("project",project);
set_default("branch",branch);
set_default("folder",folder);
set_default("doc",doc);
}

function run_query(query)
{
// console.info("Running query '" + query + "'...")
var r = new XMLHttpRequest();
r.open('GET',query,false);
if ( github_authorization_token != null )
{
// console.info("API authorization token: ",github_authorization_token);
r.setRequestHeader("Authorization","token " + github_authorization_token);
}
r.send(null);
// console.info(" status -> " + r.status);
return r;
}
function reload_frameset()
{
top.frames.document.location.href=top.frames.document.location.href;
}

function cookie_view()
{
if ( document.cookie == "" )
alert("No data stored");
else if ( document.cookie.indexOf("BLOCKED=") >= 0 )
alert("The cookie is blocked. Use 'Clear' to unblock it.")
else
alert("Current data:\n\n" + document.cookie);
}

function cookie_clear(no_confirm)
{
if ( no_confirm || confirm("Clearing the cookie will delete all current data and unblock the cookie.\n\nIs this ok? ") )
{
var cookies = document.cookie.split(";");
for (var i = 0; i < cookies.length; i++) {
var cookie = cookies[i];
var eqPos = cookie.indexOf("=");
var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;
document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT";
}
}
}

function cookie_block()
{
if ( confirm("Blocking the cookie will delete all current data.\n\nIs this ok?") )
{
cookie_clear(true);
document.cookie = "BLOCKED";
}
}
Loading

0 comments on commit ddf819e

Please sign in to comment.