Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
# Conflicts:
#	cli/requirements.txt
  • Loading branch information
Paul Cuddihy committed Feb 21, 2023
2 parents e5a54c5 + 35bb1cd commit 96c4d5d
Show file tree
Hide file tree
Showing 20 changed files with 117 additions and 133 deletions.
45 changes: 14 additions & 31 deletions .github/workflows/assemble-files.yml
Expand Up @@ -5,30 +5,13 @@ on:

jobs:

# cache-files job:
# - Asks cache for rack-box files
# assemble-files job:
# - Downloads certain files for rack-box builds
# - Packages certain files for rack-box builds
# - Uploads rack-box files to artifacts

cache-files:
runs-on: ubuntu-20.04
outputs:
cache-hit: ${{ steps.cache.outputs.cache-hit }}

steps:
- name: Ask cache for rack-box files
uses: actions/cache@v3
id: cache
with:
path: RACK/rack-box/files
key: files-${{ github.sha }}

# download-files job:
# - Downloads files for rack-box builds
# - Packages files for rack-box builds

download-files:
needs: cache-files
runs-on: ubuntu-20.04
if: needs.cache-files.outputs.cache-hit == false
assemble-files:
runs-on: ubuntu-22.04

steps:
- name: Start rack-box container (needed for CDR files)
Expand All @@ -49,17 +32,10 @@ jobs:
repository: ge-high-assurance/RACK.wiki
path: RACK.wiki

- name: Prepare to cache rack-box files
uses: actions/cache@v3
id: cache
with:
path: RACK/rack-box/files
key: files-${{ github.sha }}

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: '3.10'

- name: Cache Python dependencies
uses: actions/cache@v3
Expand Down Expand Up @@ -150,3 +126,10 @@ jobs:
shell: bash
run: |
docker container stop $(docker container ls -qf ancestor=gehighassurance/rack-box:dev)
- name: Upload rack-box files to artifacts
uses: actions/upload-artifact@v3
with:
name: rack-box-files
path: RACK/rack-box/files
retention-days: 1
16 changes: 5 additions & 11 deletions .github/workflows/build-docker-image.yml
Expand Up @@ -15,11 +15,12 @@ on:
jobs:

# build-docker-image job:
# - Downloads rack-box files from artifacts
# - Builds rack-box docker image
# - Pushes docker image to Docker Hub

build-docker-image:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- name: Check out RACK source
Expand All @@ -28,18 +29,11 @@ jobs:
repository: ge-high-assurance/RACK
path: RACK

- name: Ask cache for rack-box files
uses: actions/cache@v3
id: cache
- name: Download rack-box files from artifacts
uses: actions/download-artifact@v3
with:
name: rack-box-files
path: RACK/rack-box/files
key: files-${{ github.sha }}

- name: We don't have rack-box files?
if: steps.cache.outputs.cache-hit == false
run: |
echo "::error rack-box files are missing"
exit 1

- name: Build rack-box docker image
run: |
Expand Down
26 changes: 10 additions & 16 deletions .github/workflows/build-virtual-machine.yml
Expand Up @@ -11,8 +11,9 @@ on:
jobs:

# build-virtual-machine job:
# - Downloads rack-box files from artifacts
# - Builds rack-box virtual machine
# - Uploads virtual machine to workflow or release
# - Uploads virtual machine to artifacts or releases

build-virtual-machine:
runs-on: macos-12
Expand All @@ -24,24 +25,17 @@ jobs:
repository: ge-high-assurance/RACK
path: RACK

- name: Ask cache for rack-box files
uses: actions/cache@v3
id: cache
- name: Download rack-box files from artifacts
uses: actions/download-artifact@v3
with:
name: rack-box-files
path: RACK/rack-box/files
key: files-${{ github.sha }}

- name: We don't have rack-box files?
if: steps.cache.outputs.cache-hit == false
run: |
echo "::error rack-box files are missing"
exit 1

- name: Download base box for virtual machine
run: |
curl -LOSfs https://app.vagrantup.com/ubuntu/boxes/focal64/versions/20221115.1.0/providers/virtualbox.box
mkdir -p RACK/rack-box/focal64
tar -xf virtualbox.box -C RACK/rack-box/focal64
curl -LOSfs https://app.vagrantup.com/ubuntu/boxes/jammy64/versions/20230215.0.0/providers/virtualbox.box
mkdir -p RACK/rack-box/jammy64
tar -xf virtualbox.box -C RACK/rack-box/jammy64
rm -f virtualbox.box
- name: Build rack-box virtual machine
Expand All @@ -57,7 +51,7 @@ jobs:
split -b 1500m rack-box-${{ inputs.version }}.zip rack-box-${{ inputs.version }}.zip
rm rack-box-${{ inputs.version }}.zip
- name: Upload split virtual machine to workflow
- name: Upload virtual machine to artifacts
uses: actions/upload-artifact@v3
if: github.event_name != 'release'
with:
Expand All @@ -70,7 +64,7 @@ jobs:
# against it; replace it with "gh release upload" if CI fails
# run: gh release upload ${{ github.event.release.tag_name }} RACK/rack-box/GitHub-Release-README.md RACK/rack-box/rack-box-${{ inputs.version }}.zip* --clobber

- name: Upload split virtual machine to release
- name: Upload virtual machine to releases
uses: softprops/action-gh-release@v1
if: github.event_name == 'release'
with:
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/continuous.yml
Expand Up @@ -12,7 +12,7 @@ jobs:
# - Lints RACK CLI, RACK Ontology, and shell scripts

lint:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- name: Check out RACK source
Expand All @@ -21,7 +21,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: '3.10'

- name: Cache Python dependencies
uses: actions/cache@v3
Expand Down Expand Up @@ -62,11 +62,13 @@ jobs:
uses: ./.github/workflows/assemble-files.yml

# test job:
# - Downloads rack-box files from artifacts
# - Installs rack-box on runner
# - Runs rack-box tests

test:
needs: assemble-files
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- name: Check out RACK source
Expand All @@ -75,16 +77,16 @@ jobs:
repository: ge-high-assurance/RACK
path: RACK

- name: Ask cache for rack-box files
uses: actions/cache@v3
- name: Download rack-box files from artifacts
uses: actions/download-artifact@v3
with:
name: rack-box-files
path: RACK/rack-box/files
key: files-${{ github.sha }}

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: '3.10'

- name: Cache Python dependencies
uses: actions/cache@v3
Expand All @@ -97,7 +99,7 @@ jobs:
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install rack-box files on runner
- name: Install rack-box on runner
run: |
mkdir -p /tmp/files
for f in RACK/rack-box/files/*; do
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/update-wiki.yml
Expand Up @@ -13,7 +13,7 @@ jobs:
# - Updates RACK-Predefined-Queries.md in RACK.wiki

update-wiki:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- name: Check out RACK source
Expand All @@ -31,14 +31,14 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: '3.10'

- name: Cache Python dependencies
uses: actions/cache@v3
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit
# Look to see if there is a cache hit for cvstomd
key: ${{ runner.os }}-pip-csvtomd
restore-keys: |
${{ runner.os }}-pip-
Expand Down
3 changes: 1 addition & 2 deletions RACK-Ontology/ontology/PROV-S.sadl
Expand Up @@ -24,8 +24,7 @@ NODE is a class.


THING (note "A piece of data stored in RACK") is a type of NODE.
identifier (note "identifier is any data item that is used to associate items on when loading into the data store.") describes THING with values of type string.
identifier describes THING with at most 1 value.
identifier (note "identifier is any data item that is used to associate items on when loading into the data store.") describes THING with a single value of type string.
title (note "A short, human-readable identifying label.") describes THING with values of type string.
title describes THING with at most 1 value.
description (note "A free-form, multi-line, human-readable explanation of this data element.") describes THING with values of type string.
Expand Down
2 changes: 1 addition & 1 deletion ada/requirements.txt
@@ -1,5 +1,5 @@
colorama~=0.4.4
lxml
rdflib==5.0.0
rdflib==6.2.0
rope~=0.18.0
git+https://github.com/ge-high-assurance/RACK.git@vr/ScrapingToolKit-master#egg=ScrapingToolKit&subdirectory=ScrapingToolKit
2 changes: 1 addition & 1 deletion cli/README.md
Expand Up @@ -53,7 +53,7 @@ python3 setup.py install
If running on Windows, [GitBash](https://gitforwindows.org/) can be used with the following commands.

```shell
virtualenv venv
python -m venv venv
source venv/Scripts/activate
pip install --force -r requirements.txt
python setup.py install
Expand Down
16 changes: 8 additions & 8 deletions cli/dev/requirements.txt
@@ -1,8 +1,8 @@
mypy==0.961
pylint==2.14.4
pytest-docker==0.12.0
pytest==7.1.2
typed-ast==1.4.3
types-PyYAML==6.0.10
types-requests==2.28.1
types-tabulate==0.8.5
mypy==1.0.0
pylint==2.16.2
pytest-docker==1.0.1
pytest==7.2.1
typed-ast==1.5.4
types-PyYAML==6.0.12.6
types-requests==2.28.11.13
types-tabulate==0.9.0.0
9 changes: 8 additions & 1 deletion cli/optimize.sh
Expand Up @@ -4,7 +4,14 @@
set -eu

echo "Stopping Fuseki"
systemctl stop fuseki
FUSEKI_PID=$(systemctl show --property MainPID fuseki)
FUSEKI_PID=${FUSEKI_PID#"MainPID="}
if [ -n "${FUSEKI_PID}" ]; then
systemctl stop fuseki
# systemctl doesn't always seem to succeed, so be quite certain
# until we figure out why it doesn't always succeed
kill -9 "${FUSEKI_PID}" > /dev/null 2>&1
fi

RACK_DB="/etc/fuseki/databases/RACK"
RACK_FUSEKI_CONFIG="/etc/fuseki/configuration/RACK.ttl"
Expand Down
22 changes: 11 additions & 11 deletions cli/rack/__init__.py
Expand Up @@ -462,36 +462,36 @@ def manifest(
base_path = from_path.parent
for step in obj.get('steps',[]):
if 'manifest' in step:
path = step['manifest']
path = Path(step['manifest'])
dirname = Path(f'{self.next_fresh():02}_manifest')
subdir = to_path.parent.joinpath(dirname)
topath = subdir.joinpath(Path(path).name)
topath = subdir.joinpath(path.name)
subdir.mkdir(exist_ok=False)
self.manifest(base_path.joinpath(path), topath)
step['manifest'] = str(dirname.joinpath(Path(path).name))
step['manifest'] = dirname.joinpath(path.name).as_posix()
elif 'model' in step:
path = step['model']
path = Path(step['model'])
dirname = Path(f'{self.next_fresh():02}_model')
subdir = to_path.parent.joinpath(dirname)
topath = subdir.joinpath(Path(path).name)
topath = subdir.joinpath(path.name)
subdir.mkdir(exist_ok=False)
self.model(base_path.joinpath(path), topath)
step['model'] = str(dirname.joinpath(Path(path).name))
step['model'] = dirname.joinpath(path.name).as_posix()
elif 'data' in step:
path = step['data']
path = Path(step['data'])
dirname = Path(f'{self.next_fresh():02}_data')
subdir = to_path.parent.joinpath(dirname)
topath = subdir.joinpath(Path(path).name)
topath = subdir.joinpath(path.name)
subdir.mkdir(exist_ok=False)
self.data(base_path.joinpath(path), topath)
step['data'] = str(dirname.joinpath(Path(path).name))
step['data'] = dirname.joinpath(path.name).as_posix()
elif 'nodegroups' in step:
path = step['nodegroups']
path = Path(step['nodegroups'])
dirname = Path(f'{self.next_fresh():02}_nodegroups')
subdir = to_path.parent.joinpath(dirname)
subdir.mkdir(exist_ok=False)
self.nodegroups(base_path.joinpath(path), subdir)
step['nodegroups'] = str(dirname)
step['nodegroups'] = dirname.as_posix()

with open(to_path, mode='w', encoding='utf-8-sig', newline='\n') as out:
yaml.safe_dump(obj, out)
Expand Down
30 changes: 15 additions & 15 deletions cli/requirements.txt
@@ -1,19 +1,19 @@
ase==3.22.1
attrs==21.4.0
attrs==22.2.0
certifi==2022.12.7
chardet==5.0.0
colorama==0.4.5
idna==3.3
importlib-metadata==4.12.0
jsonschema==3.2.0
pyrsistent==0.18.1
chardet==5.1.0
colorama==0.4.6
idna==3.4
importlib-metadata==6.0.0
jsonschema==4.17.3
pyrsistent==0.19.3
python-dateutil==2.8.2
PyYAML==5.4.1
requests==2.28.1
Pillow==9.0.1
plotly==5.9.0
semtk-python3 @ git+https://github.com/ge-semtk/semtk-python3@dadfade1537ea77c30a777cb544e55b2fc7e4790
PyYAML==6.0
requests==2.28.2
Pillow==9.4.0
plotly==5.13.0
semtk-python3 @ git+https://github.com/ge-semtk/semtk-python3@3794a10ba5c2065b145d88f074a7e52028c21cdb
six==1.16.0
tabulate==0.8.10
urllib3==1.26.10
zipp==3.8.1
tabulate==0.9.0
urllib3==1.26.14
zipp==3.13.0

0 comments on commit 96c4d5d

Please sign in to comment.