Skip to content

Commit

Permalink
Create version 4.3.3 (#5)
Browse files Browse the repository at this point in the history
Signed-off-by: David P. Chassin <[email protected]>
Signed-off-by: David P. Chassin <[email protected]>
Signed-off-by: Mitchell Victoriano <[email protected]>
Signed-off-by: Mitchell Victoriano <[email protected]>
Signed-off-by: Duncan Ragsdale <[email protected]>
Co-authored-by: Mitchell Victoriano <[email protected]>
Co-authored-by: aivanova5 <[email protected]>
Co-authored-by: Duncan Ragsdale <[email protected]>
  • Loading branch information
4 people authored Dec 2, 2023
1 parent b92e990 commit 3441ad0
Show file tree
Hide file tree
Showing 152 changed files with 28,285 additions and 19,374 deletions.
49 changes: 24 additions & 25 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,34 @@ name: develop

on:
push:
branches: [ develop ]
branches: [develop]
pull_request:
branches: [ develop ]
branches: [develop]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup system
run: sudo ./setup.sh --local

- name: Build gridlabd
run: sudo ./build.sh --system --parallel

- name: Install openfido
run: curl -sL https://raw.githubusercontent.com/openfido/cli/main/install.sh | sudo sh
- name: Validate system
run: sudo gridlabd -D keep_progress=TRUE -T 0 --validate -D github_actions=yes || ( sudo utilities/save_validation_errors ; false )
- name: Upload artifacts on failure
uses: actions/upload-artifact@v2
if: failure()
with:
name: validate-result
path: |
validate.txt
validate.tar.gz
- uses: actions/checkout@v3

- name: Setup system
run: sudo ./setup.sh --local

- name: Build gridlabd
run: sudo ./build.sh --system --parallel

- name: Install openfido
run: curl -sL https://raw.githubusercontent.com/openfido/cli/main/install.sh | sudo sh

- name: Validate system
run: sudo gridlabd -D keep_progress=TRUE -T 0 --validate -D github_actions=yes || ( sudo utilities/save_validation_errors ; false )

- name: Upload artifacts on failure
uses: actions/upload-artifact@v2
if: failure()
with:
name: validate-result
path: |
validate.txt
validate.tar.gz
9 changes: 6 additions & 3 deletions COPYRIGHT
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
HiPAS GridLAB-D Version 4.2
Copyright (C) 2020, Regents of the Leland Stanford Junior University
All Rights Reserved
Arras Energy Version 4.3
Copyright (C) 2023-, LF Energy

HiPAS GridLAB-D 4.1-4.2
Copyright (C) 2020-2022, Regents of the Leland Stanford Junior University

GridLAB-D Version 1.0-4.0
Copyright (C) 2004-2019, Battelle Memorial Institute
All Rights Reserved

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
19 changes: 15 additions & 4 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
# Authors:
# DP Chassin ([email protected])

.SILENT:

$(info Current target is $(shell $(top_srcdir)/build-aux/version.sh --name))

# !!! must match version specified in configure.ac
Expand Down Expand Up @@ -50,13 +52,15 @@ AM_LDFLAGS += -module
AM_LDFLAGS += -avoid-version
AM_LDFLAGS += -export-dynamic
AM_LDFLAGS += $(GLD_LDFLAGS) -lpython$(PYVER)
AM_LIBTOOLFLAGS = --quiet

# makefile fragments populate these variables
BUILT_SOURCES =
CLEANFILES =
EXTRA_DIST =
dist_pkgdata_DATA = requirements.txt
pkgdata_DATA =
pkginclude_HEADERS =
noinst_LTLIBRARIES =
pkglib_LTLIBRARIES =
bin_PROGRAMS =
Expand All @@ -66,7 +70,7 @@ dist_doc_DATA =
docs_targets =

check-target:
@test $(prefix) = $(shell build-aux/version.sh --install) || ( echo "ERROR [Makefile]: prefix and target mismatch; ./configure is outdated. Build using '--clean' option to fix this." > /dev/stderr ; false )
@test $(prefix) = $(shell $(top_srcdir)/build-aux/version.sh --install) || ( echo "ERROR [Makefile]: prefix '$(prefix)' and target '($(shell $(top_srcdir)/build-aux/version.sh --install))' mismatch; ./configure is outdated. Build using '--clean' option to fix this." > /dev/stderr ; false )

# required modules
include $(top_srcdir)/third_party/Makefile.mk
Expand Down Expand Up @@ -123,7 +127,7 @@ python-venv:
# NB: it's ok to use the runner's python to generate the requirements.txt file
requirements.txt: python/requirements.csv
@python3 -m pip -q install pandas==2.0.0
@python3 python/requirements.py $< >$@
@python3 $(top_srcdir)/python/requirements.py $< >$@

$(PYENV): requirements.txt
@$(SYSPYTHON) --version 1>/dev/null || ( echo "ERROR [Makefile]: $(SYSPYTHON) is not found" > /dev/stderr ; false )
Expand All @@ -134,7 +138,7 @@ $(PYENV): requirements.txt
@$(ENVPYTHON) --version 1>/dev/null || ( echo "ERROR [Makefile]: $(ENVPYTHON) is not found" > /dev/stderr ; false )
@$(ENVPYTHON) -m pip install --upgrade pip
@$(ENVPYTHON) -m pip install pandas==2.0.0
@$(ENVPYTHON) python/requirements.py --buildenv | bash
@$(ENVPYTHON) $(top_srcdir)/python/requirements.py --buildenv | bash
@$(ENVPYTHON) -m pip install -r requirements.txt
@touch $(PYENV)

Expand Down Expand Up @@ -291,11 +295,18 @@ $(PREFIX)/docker.img: docker/Dockerfile Makefile
@mkdir -p $(prefix)
docker save $(PACKAGE)/$(PACKAGE_VERSION)-$(PACKAGE_BRANCH):latest -o $(prefix)/docker.img

system: python-install install
system: python-install install $(prefix)/src
@echo "Setting $$($(top_srcdir)/build-aux/version.sh --install) to the current system version"
@$(prefix)/bin/gridlabd version set
@test "$$(gridlabd --version=install)" = "$$($(top_srcdir)/build-aux/version.sh --install)" || echo 'WARNING : build and install versions differ; use build `--clean` option to fix this problem'

$(prefix)/src:
@echo Copying source files to $@...
@mkdir -p $(prefix)/src/source $(prefix)/src/python $(prefix)/src/module
@cp $(top_srcdir)/source/*.cpp $(prefix)/src/source
@cp $(top_srcdir)/python/*.cpp $(prefix)/src/python
@chmod -R 775 $(prefix)/src

index: weather library template

html-local: module-html developer-html troubleshooting-html
Expand Down
54 changes: 22 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,17 @@
---

<div align=center><H3>IMPORTANT NOTICE</H3></div>

This is the last release of HiPAS GridLAB-D before it is transferred to LF Energy's [Arras Energy project](https://github.com/arras-energy).

---

| Repository | Build | Deploy |
| :---: | :---: | :---: |
| [GridLAB-D](https://github.com/arras-energy/gridlabd) | ![master](https://github.com/arras-energy/gridlabd/actions/workflows/master.yml/badge.svg?branch=master) ![develop](https://github.com/arras-energy/gridlabd/workflows/develop/badge.svg?branch=develop) | [![master-images](https://github.com/arras-energy/gridlabd/actions/workflows/master-image.yml/badge.svg)](https://github.com/arras-energy/gridlabd/actions/workflows/master-image.yml) [![develop-images](https://github.com/arras-energy/gridlabd/actions/workflows/develop-image.yml/badge.svg)](https://github.com/arras-energy/gridlabd/actions/workflows/develop-image.yml) |
| [Templates](https://github.com/arras-energy/gridlabd-template) | [![master](https://github.com/arras-energy/gridlabd-template/actions/workflows/master.yml/badge.svg)](https://github.com/arras-energy/gridlabd-template/actions/workflows/master.yml) [![develop](https://github.com/arras-energy/gridlabd-template/actions/workflows/develop.yml/badge.svg)](https://github.com/arras-energy/gridlabd-template/actions/workflows/develop.yml)
| [Weather](https://github.com/arras-energy/gridlabd-weather) | [![validate](https://github.com/arras-energy/gridlabd-weather/actions/workflows/validate.yml/badge.svg)](https://github.com/arras-energy/gridlabd-weather/actions/workflows/validate.yml)
| [Library](https://github.com/arras-energy/gridlabd-library) | [![validate](https://github.com/arras-energy/gridlabd-library/actions/workflows/master.yml/badge.svg)](https://github.com/arras-energy/gridlabd-library/actions/workflows/master.yml) [![validate](https://github.com/arras-energy/gridlabd-library/actions/workflows/develop.yml/badge.svg)](https://github.com/arras-energy/gridlabd-library/actions/workflows/develop.yml)
| [Models](https://github.com/arras-energy/gridlabd-models) | [![validate](https://github.com/arras-energy/gridlabd-models/actions/workflows/validate.yml/badge.svg)](https://github.com/arras-energy/gridlabd-models/actions/workflows/validate.yml)
| [Benchmarks](https://github.com/arras-energy/gridlabd-benchmarks) | Manual test (see [README.md](https://github.com/arras-energy/gridlabd-benchmarks/blob/main/README.md))
| [Examples](https://github.com/arras-energy/gridlabd-examples) | Manual test (see [README.md](https://github.com/arras-energy/gridlabd-examples/blob/master/README.md))


The documentation for this project is located at http://docs.gridlabd.us/.

This respository contains the source code to HiPAS GridLAB-D, which is being developed by SLAC National Accelerator Laboratory for the California Energy Commission under grant [EPC-17-046](https://www.energy.ca.gov/filebrowser/download/1147). This version of GridLAB-D is intended to be a commercial-grade version of the [US Department of Energy's research version of GridLAB-D developed by Pacific Northwest National Laboratory](https://github.com/gridlab-d/gridlab-d).

*Note*: This fork of [GridLAB-D](https://github.com/gridlab-d/gridlab-d) does not support MS Windows directly. You must use docker or a virtual machine running linux.

# Quick start using Docker

The preferred method for running HiPAS GridLAB-D is to download the master image from docker hub (see https://hub.docker.com/repository/docker/arras-energy/gridlabd). You must install the docker daemon to use docker images. See https://www.docker.com/get-started for details.
The preferred method for running Arras Energy is to download the master image from docker hub (see https://hub.docker.com/repository/docker/lfenergy/arras/general). You must install the docker daemon to use docker images. See https://www.docker.com/get-started for details.

Once you have installed docker, you may issue the following commands to run GridLAB-D at the command line:

~~~
docker run -it -v $PWD:/model arras-energy/gridlabd:latest gridlabd -W /model [LOADOPTIONS] [FILENAME.EXT] [RUNOPTIONS]
docker run -it -v $PWD:/model lfenergy/arras:latest gridlabd -W /model [LOADOPTIONS] [FILENAME.EXT] [RUNOPTIONS]
~~~

On many systems, an alias can be used to make this a simple command that resembles the command you would normally issue to run a host-based installation:

~~~
alias gridlabd='docker run -it -v $PWD:/tmp arras-energy/gridlabd:latest gridlabd'
alias gridlabd='docker run -it -v $PWD:/tmp lfenergy/arras:latest gridlabd'
~~~

Note that this alias will interfere with any host-based installation. You may use the `gridlabd docker` command to manage the use of docker images concurrently with host-based installations.
Expand Down Expand Up @@ -86,7 +61,7 @@ Note that the installer only works with image name that conform to the name patt

# Build from source

The prerequesites for building HiPAS GridLAB-D from source include `git` and `curl`. In general you can use the `setup.sh` script to verify and update your system so that the prerequesites are satisifed.
The prerequesites for building Arras Energy from source include `git` and `curl`. In general you can use the `setup.sh` script to verify and update your system so that the prerequesites are satisifed.

On most systems, the process is as follows:

Expand Down Expand Up @@ -159,17 +134,32 @@ cd gridlabd
./build.sh --system --validate
~~~

The validation may take some time and it need not complete completely successfully for GridLAB-D to be used. The final report may look something like this:

~~~
Validation report:
747 models tested
1 unexpected errors
746 tests succeeded
>99% success rate
Total validation elapsed time: 281.9 seconds
See '/HOME/USER/gridlabd/validate.txt' for details
ERROR [build.sh]: unable to verify install
~~~

## Windows WSL

Generally, running HiPAS GridLAB-D on Docker is preferred because it is usually faster. Building, running and installing Gridlabd in WSL is not that different from a normal linux installation. You can follow Microsoft's instructions on setting up WSL and adding/changing distro's [here](https://learn.microsoft.com/en-us/windows/wsl/install). These instructions work for both cases on supported operating systems, which you can find in the build-aux directory.
GridLAB-D supports several WSL distributions, including the latest Ubuntu versions. See the [setup](setup) folder for currently supported distributions.

Generally, running Arras Energy on Docker is preferred because it is usually faster. Building, running and installing Gridlabd in WSL is not that different from a normal linux installation. You can follow Microsoft's instructions on setting up WSL and adding/changing distro's [here](https://learn.microsoft.com/en-us/windows/wsl/install). These instructions work for both cases on supported operating systems, which you can find in the build-aux directory.

1) Open PowerShell as administrator or run the WSL (Ubuntu) from the start menu to open a dedicated terminal
2) Run `wsl` (Using Ubuntu)
3) Follow the Linux build procedure above.

## Manual Build

You can build HiPAS GridLAB-D manually by running following commands in the top level repository folder:
You can build Arras Energy manually by running following commands in the top level repository folder:

1. Create the target folder:

Expand Down Expand Up @@ -256,5 +246,5 @@ This version of GridLAB-D is derived from the original US Department of Energy v

## Contributions

Please see https://source.gridlabd.us/blob/master/CONTRIBUTING.md for information on making contributions to this repository.
Please see [Arras Energy Contribution Policies](https://github.com/arras-energy/.github/blob/main/CONTRIBUTING.md) for information on making contributions to this repository.

4 changes: 2 additions & 2 deletions build-aux/version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
## --install the install folder path name, e.g., /usr/local/opt/gridlabd/4.3.1-230426-master-ubuntu_22-x86_64
## --name the install folder base name, /usr/local/opt/gridlabd/4.3.1-230426-master-ubuntu_22-x86_64
## --package the package name, e.g., gridlabd
## --package-name the package full name, e.g., HiPAS GridLAB-D
## --package-name the package full name, e.g., Arras Energy
## --machine the machine type, e.g., x86_64
## --system the system name, e.g., ubuntu_22
## --sysspec the system specification, e.g., ubuntu_22-x86_64
Expand All @@ -25,7 +25,7 @@
#
EXE=$0
PYV=3.10
TOP=$(cd ${EXE/version.sh/..}; pwd)
TOP=$(cd $(dirname $EXE)/.. 1>/dev/null; pwd)
FIL="${TOP}/source/version.h"
MAJ=`sed -En 's/#define REV_MAJOR ([0-9]+).*/\1/p' $FIL | tr -d '\n'`
MIN=`sed -En 's/#define REV_MINOR ([0-9]+).*/\1/p' $FIL | tr -d '\n'`
Expand Down
27 changes: 23 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@
## --parallel[=N]) Run the build in parallel if possible. N specifies how many jobs
## per CPU. The default is 3 jobs per CPU.
##
## --srcdir=DIR Specify an alternate source directory to use (default is
## same as build.sh script)
##
## --workdir=DIR Specify an alternate working directory to use (default is
## same as build.sh script)
##
## Environment variables:
##
## MAKEFLAGS Specify additional make options
Expand All @@ -47,6 +53,7 @@
##
## $ ./build.sh --parallel --system
##
cd $(dirname $0)
STDOUT=/dev/stdout
STDERR=/dev/stderr
error () { echo "ERROR [build.sh]: $*" > $STDERR ; exit 1; }
Expand All @@ -57,6 +64,9 @@ else
CONFIGURE=
fi
UPLOAD=
SRCDIR=$PWD
WORKDIR=$PWD
SILENT_RULES="--enable-silent-rules"
while [ $# -gt 0 ]; do
case "$1" in
-h | --help | help )
Expand All @@ -66,6 +76,7 @@ while [ $# -gt 0 ]; do
-v | --verbose )
set -x
MAKEFLAGS="$MAKEFLAGS --debug V=1"
unset SILENT_RULES
;;
-s | --silent )
STDERR=/dev/null
Expand Down Expand Up @@ -111,6 +122,14 @@ while [ $# -gt 0 ]; do
error "unable to determine the number of available CPUs"
fi
;;
--srcdir=*)
SRCDIR=$(echo $1 | cut -f2 -d=)
;;
--workdir=* )
WORKDIR=$(echo $1 | cut -f2 -d=)
mkdir -p $WORKDIR
cd $WORKDIR
;;
* )
error "option '$1' is not valid"
;;
Expand All @@ -121,14 +140,14 @@ mkdir -p /usr/local/opt/gridlabd || error "you do not have permission to create
autoconf --version 1>/dev/null 2>&1 || error "autoconf not installed. Did you run setup.sh?"
test "$(autoconf --version 2>/dev/null | head -n 1 | grep -o '[^ ]*$')" = "2.71" || error "autoconf version 2.71 required. Did you run setup.sh?"
git --version 1>/dev/null 2>&1 || error "you must install git to build GridLAB-D"
test -f configure.ac || error "you must build from the source directory where configure.ac is located"
test -f $SRCDIR/configure.ac || error "you must build from the source directory where configure.ac is located"
test -f $HOME/.gridlabd/bin/activate || error "$HOME/.gridlabd is not found. Run setup.sh again."
test ! -z "$VIRTUAL_ENV" || . $HOME/.gridlabd/bin/activate 1>$STDOUT 2>$STDERR
test ! -z "$VIRTUAL_ENV" || error "unable to activate gridlabd venv"
test -f ./configure || autoreconf -isf 1>$STDOUT 2>$STDERR || error "autoconf failed"
test -f Makefile || ./configure $CONFIGURE 1>$STDOUT 2>$STDERR || error "./configure failed"
test -f $SRCDIR/configure || autoreconf -isf $SRCDIR 1>$STDOUT 2>$STDERR || error "autoconf failed"
test -f Makefile || $SRCDIR/configure $SILENT_RULES $CONFIGURE 1>$STDOUT 2>$STDERR || error "./configure failed"
make $MAKEFLAGS $TARGET 1>$STDOUT 2>$STDERR || error "unable to make build"
if [ ! -z "$VERIFY" ]; then
$(build-aux/version.sh --install)/bin/gridlabd $VERIFY 1>$STDOUT 2>$STDERR || error "unable to verify install"
$($SRCDIR/build-aux/version.sh --install)/bin/gridlabd $VERIFY 1>$STDOUT 2>$STDERR || error "unable to verify install"
fi
test -z "$UPLOAD" || make $UPLOAD 1>$STDOUT 2>$STDERR
4 changes: 2 additions & 2 deletions cloud/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ cloud-deploy: aws-deploy gcp-deploy az-deploy
# Get a list of files that have to be updated
#

WEBSITES=$(shell find cloud/websites/*.gridlabd.us -type d -prune)
WEBSITES=$(shell find $(top_srcdir)/cloud/websites/*.gridlabd.us -type d -prune)

#
# Target that forces updates
Expand Down Expand Up @@ -93,4 +93,4 @@ $(top_srcdir)/cloud/websites/install.gridlabd.us/requirements.txt:
@cat $$(find $(top_srcdir) -name requirements.txt -print) | sort -u > $@

$(top_srcdir)/cloud/websites/install.gridlabd.us/validate.tarz:
@tar cfz $@ $$(find $(top_srcdir) -type d -name autotest -print -prune )
@tar cfz $@ $$(find $(top_srcdir) -type d -name autotest -print -prune )
2 changes: 1 addition & 1 deletion cloud/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ Deliver version information.

# `www.gridlabd.us`

General landing page for HiPAS GridLAB-D.
General landing page for Arras Energy.
18 changes: 6 additions & 12 deletions cloud/websites/docs.gridlabd.us/index.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
<!DOCTYPE HTML />
<HTML>
<SCRIPT LANGUAGE="Javascript" SRC="_defaults.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
document.writeln('<FRAMESET ROWS="' + (top_panel_height+20) + ',*" BORDER=2>');
console.info(window.location.search)
document.writeln('<FRAME SRC="_topbar.html" NORESIZE="noresize"></FRAME>');
document.writeln('<FRAMESET COLS="320,*" BORDER=3>');
document.writeln('<FRAME NAME="contents" SRC="_contents.html' + window.location.search + '"></FRAME>');
document.writeln('<FRAME NAME="page" SRC="_page.html' + window.location.search + '"></FRAME>');
document.writeln('</FRAMESET>');
document.writeln('</FRAMESET>');
</SCRIPT>

<HEAD>
<META HTTP-EQUIV="refresh" CONTENT="0,url=http://docs.gridlabd.us/index.html?owner=arras-energy&project=gridlabd" />
</HEAD>
<BODY>
Redirecting to <A HREF="http://docs.gridlabd.us/index.html?owner=arras-energy&project=gridlabd">http://docs.arras-energy.org/index.html?owner=arras-energy&project=gridlabd</A>...
</BODY>
</HTML>
Loading

0 comments on commit 3441ad0

Please sign in to comment.