Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #14

Merged
merged 19 commits into from
Oct 15, 2024
Merged

Dev #14

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

name: Deploy to demo
name: Deploy to dev

on:
workflow_dispatch:
push:
tags:
- v*
branches:
- dev

permissions:
contents: read
Expand All @@ -16,7 +16,7 @@ jobs:

deploy:

name: Deploy to demo
name: Deploy to dev
runs-on: ubuntu-latest

steps:
Expand All @@ -26,7 +26,7 @@ jobs:

- name: Get version
id: version
run: echo VERSION=$(git describe --exact-match --tags | sed 's/^v//') >> $GITHUB_OUTPUT
run: make version >> $GITHUB_OUTPUT

- name: Install deps
run: npm install
Expand Down Expand Up @@ -58,9 +58,9 @@ jobs:
uses: pulumi/actions@v3
with:
command: up
stack-name: demo
stack-name: dev
work-dir: pulumi
cloud-url: gs://trustgraph-deploy/config-ui/demo
cloud-url: gs://trustgraph-deploy/config-ui
env:
PULUMI_CONFIG_PASSPHRASE: ""
IMAGE_VERSION: ${{ steps.version.outputs.VERSION }}
Expand Down
67 changes: 67 additions & 0 deletions .github/workflows/deploy-prod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@

name: Deploy to prod

on:
workflow_dispatch:
push:
branches:
- prod

permissions:
contents: read
id-token: 'write'
packages: read

jobs:

deploy:

name: Deploy to prod
runs-on: ubuntu-latest

steps:

- name: Checkout
uses: actions/checkout@v3

- name: Get version
id: version
run: make version >> $GITHUB_OUTPUT

- name: Install deps
run: npm install

- name: Build container
run: make VERSION=${{ steps.version.outputs.VERSION }}

- id: auth
name: Authenticate with Google Cloud
uses: google-github-actions/auth@v2
with:
token_format: access_token
workload_identity_provider: projects/583813057664/locations/global/workloadIdentityPools/deploy/providers/github
service_account: [email protected]
access_token_lifetime: 900s
create_credentials_file: true

- name: Login to Artifact Registry
uses: redhat-actions/podman-login@v1
with:
registry: us-central1-docker.pkg.dev
username: oauth2accesstoken
password: ${{ steps.auth.outputs.access_token }}

- name: Install Pulumi
run: cd pulumi && npm install

- name: Applying infrastructure 🚀🙏
uses: pulumi/actions@v3
with:
command: up
stack-name: prod
work-dir: pulumi
cloud-url: gs://trustgraph-deploy/config-ui
env:
PULUMI_CONFIG_PASSPHRASE: ""
IMAGE_VERSION: ${{ steps.version.outputs.VERSION }}

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

name: Undeploy to demo
name: Undeploy to dev

on:
workflow_dispatch:
Expand All @@ -12,7 +12,7 @@ jobs:

deploy:

name: Undeploy to demo
name: Undeploy to dev
runs-on: ubuntu-latest

steps:
Expand All @@ -37,9 +37,9 @@ jobs:
uses: pulumi/actions@v3
with:
command: destroy
stack-name: demo
stack-name: dev
work-dir: pulumi
cloud-url: gs://kalntera-deploy/cybersec-ai/demo
cloud-url: gs://trustgraph-deploy/config-ui
env:
PULUMI_CONFIG_PASSPHRASE: ""

45 changes: 45 additions & 0 deletions .github/workflows/undeploy-prod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@

name: Undeploy to prod

on:
workflow_dispatch:

permissions:
contents: read
id-token: 'write'

jobs:

deploy:

name: Undeploy to prod
runs-on: ubuntu-latest

steps:

- name: Checkout
uses: actions/checkout@v3

- id: auth
name: Authenticate with Google Cloud
uses: google-github-actions/auth@v0
with:
token_format: access_token
workload_identity_provider: projects/514167726704/locations/global/workloadIdentityPools/deploy/providers/deploy
service_account: [email protected]
access_token_lifetime: 900s
create_credentials_file: true

- name: Install Pulumi
run: cd pulumi && npm install

- name: Destroy infrastructure ☠🔥
uses: pulumi/actions@v3
with:
command: destroy
stack-name: prod
work-dir: pulumi
cloud-url: gs://trustgraph-deploy/config-ui
env:
PULUMI_CONFIG_PASSPHRASE: ""

5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@

VERSION=0.1.0
VERSION=0.3.1

all: service-package container

version:
@echo VERSION=${VERSION}

ui:
npm run build
rm -rf config-ui/config_ui/ui/
Expand Down
2 changes: 1 addition & 1 deletion config-ui/config_ui/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ async def everything(self, request):
raise web.HTTPInternalServerError()

def process(
self, config, version="0.11.20", platform="docker-compose",
self, config, version="0.12.5", platform="docker-compose",
):

config = config.encode("utf-8")
Expand Down
14 changes: 14 additions & 0 deletions pulumi/Pulumi.dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
encryptionsalt: v1:vQGk98eEeYI=:v1:tHg+f1b66tEydgA9:J1RGVNI0FssyjSXVhcKU7bfBofNFTg==
config:
config-ui:artifact-name: config-ui-dev
config-ui:artifact-repo: us-central1-docker.pkg.dev/trustgraph-demo/config-ui-dev
config-ui:artifact-repo-region: us-central1
config-ui:cloud-run-region: us-central1
config-ui:domain: demo.trustgraph.ai
config-ui:environment: dev
config-ui:gcp-project: trustgraph-demo
config-ui:gcp-region: us-central1
config-ui:hostname: dev.config-ui.demo.trustgraph.ai
config-ui:managed-zone: demo
config-ui:max-scale: "2"
config-ui:min-scale: "0"
6 changes: 3 additions & 3 deletions pulumi/Pulumi.demo.yaml → pulumi/Pulumi.prod.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
encryptionsalt: v1:vQGk98eEeYI=:v1:tHg+f1b66tEydgA9:J1RGVNI0FssyjSXVhcKU7bfBofNFTg==
config:
config-ui:artifact-name: config-ui
config-ui:artifact-repo: us-central1-docker.pkg.dev/trustgraph-demo/config-ui
config-ui:artifact-name: config-ui-prod
config-ui:artifact-repo: us-central1-docker.pkg.dev/trustgraph-demo/config-ui-prod
config-ui:artifact-repo-region: us-central1
config-ui:cloud-run-region: us-central1
config-ui:domain: demo.trustgraph.ai
config-ui:environment: demo
config-ui:environment: prod
config-ui:gcp-project: trustgraph-demo
config-ui:gcp-region: us-central1
config-ui:hostname: config-ui.demo.trustgraph.ai
Expand Down
4 changes: 2 additions & 2 deletions pulumi/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const image = new local.Command(
const svcAccount = new gcp.serviceaccount.Account(
"service-account",
{
accountId: "config-ui",
accountId: "config-ui-" + environment,
displayName: "Config UI",
description: "Config UI",
},
Expand Down Expand Up @@ -118,7 +118,7 @@ const vertexAiUserMember = new gcp.projects.IAMMember(
const service = new gcp.cloudrun.Service(
"service",
{
name: "config-ui",
name: "config-ui-" + environment,
location: cloudRunRegion,
template: {
metadata: {
Expand Down
11 changes: 9 additions & 2 deletions src/App.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
#root {
margin: 0 auto;
padding: 1rem;
margin: 0 auto;
padding: 1rem;
height: 100vh;
}

body {
width: 100vh;
height: 100vh;
margin: 0;
}

29 changes: 29 additions & 0 deletions src/simple-editor/Banner.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

import React from 'react';

import { Typography, Box, Stack } from '@mui/material';

const Banner: React.FC = () => {

return (

<Stack
alignItems="center"
direction="row"
gap={2}
sx={{ mb: 3 }}
>
<Box>
<img src="/tg.svg" alt="Trustgraph logo"
height="45"/>
</Box>
<Typography variant="h4" component="h1">
TrustGraph configuration creator
</Typography>
</Stack>
);

}

export default Banner;

55 changes: 0 additions & 55 deletions src/simple-editor/Chunker.tsx

This file was deleted.

Loading
Loading