Skip to content

Commit fac8013

Browse files
committed
Merge branch 'develop' of github.com:NREL/alfalfa into bump_version_1
2 parents 9953452 + 0fb1663 commit fac8013

File tree

140 files changed

+21146
-578108
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+21146
-578108
lines changed

.env

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,20 @@ AWS_ACCESS_KEY_ID=user
22
AWS_SECRET_ACCESS_KEY=password
33
GF_SECURITY_ADMIN_PASSWORD=password
44
GF_SECURITY_ADMIN_USER=admin
5-
INFLUXDB_ADMIN_PASSWORD=password
6-
INFLUXDB_ADMIN_USER=admin
5+
INFLUXDB_PASSWORD=password
6+
INFLUXDB_USERNAME=admin
77
INFLUXDB_DB=alfalfa
88
INFLUXDB_HOST=influxdb
99
INFLUXDB_HTTP_AUTH_ENABLED=true
1010
JOB_QUEUE=Alfalfa Job Queue
1111
LOGGING=false
12-
MONGO_DB_NAME=alfalfa
13-
MONGO_URL=mongodb://mongo:27017
12+
MONGO_INITDB_ROOT_USERNAME=admin
13+
MONGO_INITDB_ROOT_PASSWORD=password
14+
MONGO_INITDB_DATABASE=alfalfa
15+
MONGO_URL=mongodb://admin:password@mongo:27017/alfalfa?authSource=admin
1416
NODE_ENV=production
15-
REDIS_HOST=redis
16-
REGION=us-west-1
17+
REDIS_URL=redis://redis:6379/0
18+
S3_REGION=us-west-1
1719
S3_BUCKET=alfalfa
1820
S3_URL=http://minio:9000
1921
S3_URL_EXTERNAL=http://localhost:9000

.github/workflows/ci.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Install Python
2222
uses: actions/setup-python@v5
2323
with:
24-
python-version: "3.8"
24+
python-version: "3.11"
2525

2626
- name: Run pre-commit
2727
uses: pre-commit/[email protected]
@@ -39,7 +39,7 @@ jobs:
3939
- name: Install Python
4040
uses: actions/setup-python@v5
4141
with:
42-
python-version: "3.8"
42+
python-version: "3.11"
4343

4444
- name: Install poetry
4545
uses: abatilo/actions-poetry@v3
@@ -76,7 +76,7 @@ jobs:
7676
uses: docker/setup-buildx-action@v3
7777

7878
- name: Build
79-
uses: docker/bake-action@v4
79+
uses: docker/bake-action@v5
8080
with:
8181
files: docker-compose.yml, docker-compose.dev.yml
8282
set: |
@@ -92,7 +92,7 @@ jobs:
9292
GIT_COMMIT: ${{ github.sha }}
9393
run: |
9494
printenv
95-
docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d worker mongo redis minio mc goaws
95+
docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d worker mongo redis minio mc
9696
9797
- name: Dump docker logs before tests
9898
uses: jwalton/gh-docker-logs@v2
@@ -117,7 +117,7 @@ jobs:
117117
- name: Install Python
118118
uses: actions/setup-python@v5
119119
with:
120-
python-version: "3.8"
120+
python-version: "3.11"
121121

122122
- name: Install poetry
123123
uses: abatilo/actions-poetry@v3
@@ -128,7 +128,7 @@ jobs:
128128
uses: docker/setup-buildx-action@v3
129129

130130
- name: Build
131-
uses: docker/bake-action@v4
131+
uses: docker/bake-action@v5
132132
with:
133133
files: docker-compose.yml
134134
set: |
@@ -185,7 +185,7 @@ jobs:
185185
- name: Install Python
186186
uses: actions/setup-python@v5
187187
with:
188-
python-version: "3.8"
188+
python-version: "3.11"
189189

190190
- name: Install poetry
191191
uses: abatilo/actions-poetry@v3
@@ -196,10 +196,10 @@ jobs:
196196
uses: docker/setup-buildx-action@v3
197197

198198
- name: Build
199-
uses: docker/bake-action@v4
199+
uses: docker/bake-action@v5
200200
with:
201201
load: true
202-
files: docker-compose.yml, docker-compose.dev.yml, docker-compose.historian.yml
202+
files: docker-compose.yml, docker-compose.historian.yml
203203
set: |
204204
web.cache-from=type=gha,scope=web:${{ github.ref_name }}
205205
web.output=type=docker
@@ -247,6 +247,10 @@ jobs:
247247
uses: jwalton/gh-docker-logs@v2
248248

249249
publish:
250+
permissions:
251+
contents: read
252+
packages: write
253+
name: Build and publish Docker images
250254
needs: [pre-commit, unit-tests, simulation-tests, integration-tests, integration-tests-historian]
251255
runs-on: ubuntu-latest
252256
if: github.actor != 'dependabot[bot]'
@@ -280,9 +284,6 @@ jobs:
280284
type=raw,value=latest,enable=${{ github.event_name == 'release' }}
281285
type=edge
282286
283-
- name: Expose GitHub Runtime
284-
uses: crazy-max/ghaction-github-runtime@v3
285-
286287
- name: Build Push
287288
run: |
288289
/usr/bin/docker buildx bake \

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ repos:
2626
- id: requirements-txt-fixer
2727
- id: mixed-line-ending
2828
args: ["--fix=auto"]
29-
- repo: https://github.com/pre-commit/mirrors-autopep8
30-
rev: v2.0.1
29+
- repo: https://github.com/hhatto/autopep8
30+
rev: v2.3.1
3131
hooks:
3232
- id: autopep8
3333
args:

alfalfa_web/.babelrc.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,16 @@ const presets = [
1414
]
1515
];
1616

17-
if (isProd) presets.push(["minify", { builtIns: false }]);
17+
// Use Webpack's built-in Terser for minification instead of babel-preset-minify
18+
// which has compatibility issues with newer Babel versions
1819

1920
module.exports = {
2021
assumptions: {
2122
noDocumentAll: true,
2223
noClassCalls: true
2324
},
2425
comments: false,
25-
plugins: ["@babel/plugin-proposal-class-properties"],
26+
plugins: ["@babel/plugin-transform-class-properties"],
2627
presets,
2728
sourceMaps: isProd ? false : "inline"
2829
};

alfalfa_web/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:16 AS base
1+
FROM node:22-slim AS base
22
ARG GIT_COMMIT
33
ENV GIT_COMMIT=$GIT_COMMIT
44

@@ -15,7 +15,7 @@ COPY alfalfa_web /srv/alfalfa
1515

1616
ARG NODE_ENV
1717
RUN npm run build
18-
CMD [ "npm", "start" ]
18+
CMD [ "node", "build/index.js" ]
1919

2020
# **** Staged build for running in development mode ****
2121
FROM base AS dev

alfalfa_web/components/app.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@ import React from "react";
22
import "@fontsource/material-icons";
33
import "@fontsource/roboto";
44
import "normalize.css/normalize.css";
5-
import ReactDOM from "react-dom";
5+
import { createRoot } from "react-dom/client";
66
import { BrowserRouter } from "react-router-dom";
77
import { App } from "./App/App.js";
88

9-
ReactDOM.render(
9+
const container = document.getElementById("root");
10+
const root = createRoot(container);
11+
12+
root.render(
1013
<BrowserRouter>
1114
<React.StrictMode>
1215
<App />
1316
</React.StrictMode>
14-
</BrowserRouter>,
15-
document.getElementById("root")
17+
</BrowserRouter>
1618
);

0 commit comments

Comments
 (0)