Skip to content

Commit 66da4df

Browse files
author
Sean Sundberg
authored
Update config to run locally with minimal dependencies (#38)
* Update config to run locally with minimal dependencies * Add workflow to build container image Signed-off-by: Sean Sundberg <seansund@us.ibm.com>
1 parent 7eec04f commit 66da4df

13 files changed

Lines changed: 3513 additions & 2238 deletions
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Desktop (please complete the following information):**
27+
- OS: [e.g. iOS]
28+
- Browser [e.g. chrome, safari]
29+
- Version [e.g. 22]
30+
31+
**Smartphone (please complete the following information):**
32+
- Device: [e.g. iPhone6]
33+
- OS: [e.g. iOS8.1]
34+
- Browser [e.g. stock browser, safari]
35+
- Version [e.g. 22]
36+
37+
**Additional context**
38+
Add any other context about the problem here.

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "npm" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "daily"

.github/release-drafter.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name-template: 'v$RESOLVED_VERSION'
2+
tag-template: 'v$RESOLVED_VERSION'
3+
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
4+
categories:
5+
- title: 'Features'
6+
labels:
7+
- 'feature'
8+
- 'enhancement'
9+
- title: 'Bug Fixes'
10+
labels:
11+
- 'fix'
12+
- 'bugfix'
13+
- 'bug'
14+
- title: 'Maintenance'
15+
label: 'chore'
16+
version-resolver:
17+
major:
18+
labels:
19+
- 'major'
20+
minor:
21+
labels:
22+
- 'minor'
23+
patch:
24+
labels:
25+
- 'patch'
26+
default: patch
27+
template: |
28+
$CHANGES
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Docker build
2+
3+
# Controls when the workflow will run
4+
on:
5+
release:
6+
types:
7+
- published
8+
pull_request:
9+
branches:
10+
- main
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v3
19+
20+
- name: Set up QEMU
21+
uses: docker/setup-qemu-action@v2
22+
23+
- name: Set up Docker Buildx
24+
id: buildx
25+
uses: docker/setup-buildx-action@v2
26+
27+
- name: Login to Docker Hub
28+
uses: docker/login-action@v2
29+
with:
30+
username: ${{ secrets.DOCKER_USER }}
31+
password: ${{ secrets.DOCKER_TOKEN }}
32+
33+
- name: Login to CNTK Quay
34+
uses: docker/login-action@v2
35+
with:
36+
registry: quay.io
37+
username: ${{ secrets.QUAY_CNTK_USERNAME }}
38+
password: ${{ secrets.QUAY_CNTK_TOKEN }}
39+
40+
- name: Setup variables
41+
id: variables
42+
shell: bash
43+
run: |
44+
LATEST_ENABLED="true"
45+
46+
RELEASE_TAG=${GITHUB_REF#refs/tags/}
47+
RELEASE_TAG_ENABLED="false"
48+
if [[ "${GITHUB_REF}" =~ refs/tags ]] && [[ "${RELEASE_TAG}" != "main" ]]; then
49+
RELEASE_TAG_ENABLED="true"
50+
else
51+
RELEASE_TAG="main"
52+
fi
53+
54+
echo "Release tag: ${RELEASE_TAG}"
55+
echo "release-tag=$RELEASE_TAG" >> $GITHUB_OUTPUT
56+
57+
echo "Release tag enabled: $RELEASE_TAG_ENABLED"
58+
echo "release-tag-enabled=$RELEASE_TAG_ENABLED" >> $GITHUB_OUTPUT
59+
60+
echo "Latest enabled: $LATEST_ENABLED"
61+
echo "latest-enabled=$LATEST_ENABLED" >> $GITHUB_OUTPUT
62+
63+
- name: Docker CNTK meta
64+
id: cntk-meta
65+
uses: docker/metadata-action@v4
66+
with:
67+
# list of Docker images to use as base name for tags
68+
images: |
69+
${{vars.IMAGE_BASE}}
70+
# Docker tags based on the following events/attributes
71+
tags: |
72+
type=raw,value=${{ steps.variables.outputs.release-tag }},enable=${{ steps.variables.outputs.release-tag-enabled }}
73+
type=raw,value=latest
74+
75+
- name: Build and push
76+
uses: docker/build-push-action@v3
77+
with:
78+
context: .
79+
file: Dockerfile
80+
push: ${{ github.event_name != 'pull_request' }}
81+
platforms: linux/amd64,linux/arm64
82+
tags: ${{ steps.cntk-meta.outputs.tags }}
83+
labels: ${{ steps.cntk-meta.outputs.labels }}
84+
85+
notify:
86+
needs: ["build"]
87+
runs-on: ubuntu-latest
88+
if: ${{ github.event_name != 'pull_request' }}
89+
90+
strategy:
91+
matrix:
92+
repo:
93+
- ${{ github.repository }}
94+
95+
steps:
96+
- name: Repository dispatch ${{ matrix.repo }}
97+
uses: cloud-native-toolkit/action-repository-dispatch@main
98+
with:
99+
notifyRepo: ${{ matrix.repo }}
100+
eventType: released
101+
env:
102+
GITHUB_TOKEN: ${{ secrets.TOKEN }}

.github/workflows/release.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Release module
2+
3+
# Controls when the action will run. Triggers the workflow on push or pull request
4+
# events but only for the master branch
5+
on:
6+
push:
7+
branches: [ main ]
8+
9+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
10+
jobs:
11+
release:
12+
runs-on: ubuntu-latest
13+
14+
# Steps represent a sequence of tasks that will be executed as part of the job
15+
steps:
16+
# Drafts your next Release notes as Pull Requests are merged into "master"
17+
- uses: rlespinasse/github-slug-action@v3.x
18+
19+
- uses: release-drafter/release-drafter@v5
20+
with:
21+
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
22+
config-name: release-drafter.yaml
23+
publish: true
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.TOKEN }}

docker-compose.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
version: '3'
2+
services:
3+
# ascent-ui:
4+
# image: quay.io/cloudnativetoolkit/ascent-ui:0.0.77
5+
# environment:
6+
# - API_HOST=http://ascent-bff:3001
7+
# - NODE_ENV=test
8+
# ports:
9+
# - "3000:3000"
10+
# depends_on:
11+
# - ascent-bff
12+
ascent-bff:
13+
# image: quay.io/cloudnativetoolkit/ascent-bff:1.0.26
14+
build: .
15+
environment:
16+
- DATABASE_TEST={"connection":{"mongodb":{"composed":["mongodb://mongodb:27017/mongodb"],"authentication":{"username":"mongodb","password":"passw0rd"},"hosts":[{"hostname":"localhost","port":27017}],"database":"mongodb","query_options":{"authSource":"admin","tls":false}}}}
17+
- DATABASE_DEV={"connection":{"mongodb":{"composed":["mongodb://mongodb:27017/mongodb"],"authentication":{"username":"mongodb","password":"passw0rd"},"hosts":[{"hostname":"localhost","port":27017}],"database":"mongodb","query_options":{"authSource":"admin","tls":false}}}}
18+
- DATABASE={"connection":{"mongodb":{"composed":["mongodb://mongodb:27017/mongodb"],"authentication":{"username":"mongodb","password":"passw0rd"},"hosts":[{"hostname":"localhost","port":27017}],"database":"mongodb","query_options":{"authSource":"admin","tls":false}}}}
19+
command:
20+
- npm
21+
- run
22+
- serve:test
23+
ports:
24+
- "3001:3001"
25+
depends_on:
26+
- mongodb
27+
mongodb:
28+
image: docker.io/mongodb/mongodb-community-server:7.0.7-ubi9
29+
expose:
30+
- "27017"
31+
environment:
32+
- MONGO_INITDB_ROOT_USERNAME=mongodb
33+
- MONGO_INITDB_ROOT_PASSWORD=passw0rd

express-app/express-server.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ app.post('/token', (req, res, next) => {
4848
})
4949
});
5050

51+
console.log('NODE_ENV: ' + process.env.NODE_ENV + '')
5152
if (!['dev', 'test'].includes(process.env.NODE_ENV)) {
53+
console.log('Configuring App ID authentication')
5254

5355
// If the OCP_API_URL environment variable is not set, then use App ID
5456
if (!process.env.OCP_API_URL) {

0 commit comments

Comments
 (0)