Skip to content

Commit

Permalink
Feat/launch (#41)
Browse files Browse the repository at this point in the history
* launchpad

* add pipeline

* feat: config overrides

* feat: pipeline create

* feat: update and delete pipeline

* feat: confirmation delete pipeline

* feat: launcher ui

* feat: submitting jobs

* feat: confetti

* feat: comput eenv check

* fix: error message

* feat: explainer

* fix: compute env

* fix: error handling

* feat: launcher, terminator

* fix: components

* feat: graphql

* feat: graphql full

* fix: auth

* feat: graphql
  • Loading branch information
AugustDev committed Jul 20, 2024
1 parent 836ba07 commit a29255e
Show file tree
Hide file tree
Showing 70 changed files with 6,691 additions and 588 deletions.
23 changes: 23 additions & 0 deletions codegen.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { type CodegenConfig } from "@graphql-codegen/cli"
import { addTypenameSelectionDocumentTransform } from "@graphql-codegen/client-preset"

const config: CodegenConfig = {
schema: "/Users/wpc/Projects/cfdx/nf-shard-orchestrator/graph/schema.graphqls",
documents: ["src/**/*.graphql"],
ignoreNoDocuments: true,
overwrite: true,
generates: {
"./src/generated/graphql/": {
preset: "client",
plugins: [],
presetConfig: {
persistedDocuments: true,
fragmentMasking: false,
},
documentTransforms: [addTypenameSelectionDocumentTransform],
},
},
hooks: { afterAllFileWrite: ["prettier --write"] },
}

export default config
17 changes: 17 additions & 0 deletions components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "default",
"rsc": true,
"tsx": true,
"tailwind": {
"config": "tailwind.config.ts",
"css": "src/app/globals.css",
"baseColor": "slate",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils"
}
}
1 change: 1 addition & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
const nextConfig = {
distDir: "build",
output: "standalone",

// https://github.com/aws-amplify/amplify-hosting/issues/1987
env: {
POSTGRES_URI: process.env.POSTGRES_URI,
Expand Down
33 changes: 29 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,38 @@
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"dev": "next dev --turbo",
"migrate": "npx prisma migrate dev",
"generate": "npx prisma generate",
"build": "next build",
"start": "next start",
"lint": "next lint",
"studio": "npx prisma studio"
"studio": "npx prisma studio",
"codegen": "graphql-codegen --config codegen.ts"
},
"dependencies": {
"@ant-design/cssinjs": "^1.17.2",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@graphql-codegen/cli": "^5.0.2",
"@graphql-codegen/client-preset": "^4.3.2",
"@headlessui/react": "^1.7.16",
"@heroicons/react": "^2.0.18",
"@hookform/resolvers": "^3.9.0",
"@mantine/core": "^6.0.19",
"@mantine/hooks": "^6.0.19",
"@mantine/prism": "^6.0.19",
"@mui/material": "^5.14.5",
"@prisma/client": "^5.1.1",
"@radix-ui/react-checkbox": "^1.1.1",
"@radix-ui/react-dialog": "^1.1.1",
"@radix-ui/react-dropdown-menu": "^2.1.1",
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-label": "^2.1.0",
"@radix-ui/react-select": "^2.1.1",
"@radix-ui/react-separator": "^1.1.0",
"@radix-ui/react-slot": "^1.1.0",
"@radix-ui/react-tabs": "^1.1.0",
"@tailwindcss/forms": "^0.5.4",
"@tanstack/match-sorter-utils": "^8.15.1",
"@tanstack/react-table": "^8.19.2",
Expand All @@ -35,9 +48,13 @@
"antd": "^5.11.1",
"autoprefixer": "10.4.14",
"bytes": "^3.1.2",
"clsx": "^2.0.0",
"canvas-confetti": "^1.9.3",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"eslint": "8.46.0",
"eslint-config-next": "13.4.19",
"graphql": "^16.9.0",
"lucide-react": "^0.408.0",
"moment": "^2.29.4",
"nanoid": "^4.0.2",
"next": "^14.2.3",
Expand All @@ -46,15 +63,23 @@
"postcss": "8.4.27",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-hook-form": "^7.52.1",
"react-hot-toast": "^2.4.1",
"react-icons": "^4.10.1",
"react-infinite-scroll-component": "^6.1.0",
"react-plotly.js": "^2.6.0",
"sass": "^1.66.1",
"subscriptions-transport-ws": "^0.11.0",
"tailwind-merge": "^2.4.0",
"tailwindcss": "3.3.3",
"typescript": "5.1.6"
"tailwindcss-animate": "^1.0.7",
"typescript": "5.1.6",
"unique-names-generator": "^4.7.1",
"urql": "^4.1.0",
"zod": "^3.23.8"
},
"devDependencies": {
"@types/canvas-confetti": "^1.6.4",
"@types/plotly.js": "^2.12.26",
"@types/react-plotly.js": "^2.6.0",
"@types/uuid": "^9.0.2",
Expand Down
12 changes: 12 additions & 0 deletions prisma/migrations/20240714213207_computeenv/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-- CreateTable
CREATE TABLE "ComputeEnvironment" (
"id" SERIAL NOT NULL,
"name" TEXT NOT NULL,
"description" TEXT,
"is_deleted" BOOLEAN NOT NULL DEFAULT false,
"orchestrator_endpoint" TEXT NOT NULL,
"orchestrator_token" TEXT NOT NULL,
"executor" TEXT NOT NULL,

CONSTRAINT "ComputeEnvironment_pkey" PRIMARY KEY ("id")
);
14 changes: 14 additions & 0 deletions prisma/migrations/20240716113333_pipeline/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
-- CreateTable
CREATE TABLE "Pipeline" (
"id" TEXT NOT NULL,
"name" TEXT NOT NULL,
"description" TEXT NOT NULL,
"github_url" TEXT NOT NULL,
"compute_overrides" JSONB,
"run_params" JSONB,

CONSTRAINT "Pipeline_pkey" PRIMARY KEY ("id")
);

-- CreateIndex
CREATE UNIQUE INDEX "Pipeline_id_key" ON "Pipeline"("id");
9 changes: 9 additions & 0 deletions prisma/migrations/20240719162324_processkeys/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-- CreateTable
CREATE TABLE "ProcessKeys" (
"id" SERIAL NOT NULL,
"processKey" TEXT NOT NULL,
"executor" TEXT NOT NULL,
"workerUrl" TEXT NOT NULL,

CONSTRAINT "ProcessKeys_pkey" PRIMARY KEY ("id")
);
8 changes: 8 additions & 0 deletions prisma/migrations/20240719164509_processrunname/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
Warnings:
- Added the required column `runName` to the `ProcessKeys` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER TABLE "ProcessKeys" ADD COLUMN "runName" TEXT NOT NULL;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- CreateIndex
CREATE INDEX "ProcessKeys_runName_idx" ON "ProcessKeys"("runName");
12 changes: 12 additions & 0 deletions prisma/migrations/20240719185649_/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
Warnings:
- You are about to drop the column `workerUrl` on the `ProcessKeys` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE "ProcessKeys" DROP COLUMN "workerUrl",
ADD COLUMN "computeEnvironmentId" INTEGER;

-- AddForeignKey
ALTER TABLE "ProcessKeys" ADD CONSTRAINT "ProcessKeys_computeEnvironmentId_fkey" FOREIGN KEY ("computeEnvironmentId") REFERENCES "ComputeEnvironment"("id") ON DELETE SET NULL ON UPDATE CASCADE;
64 changes: 48 additions & 16 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
generator client {
provider = "prisma-client-js"
provider = "prisma-client-js"
binaryTargets = ["native", "linux-musl-openssl-3.0.x", "rhel-openssl-1.0.x"]
}

Expand All @@ -13,10 +13,10 @@ datasource db {
}

model Workflow {
id String @id
id String @id
start DateTime?
complete DateTime?
updatedAt DateTime @default(now()) @updatedAt
updatedAt DateTime @default(now()) @updatedAt
projectDir String
profile String
homeDir String
Expand Down Expand Up @@ -61,20 +61,19 @@ model Workflow {
tasks Task[]
// nf-shard specific
searchable String?
tags String[]
workspace Workspace? @relation(fields: [workspaceId], references: [id], onDelete: SetNull)
searchable String?
tags String[]
workspace Workspace? @relation(fields: [workspaceId], references: [id], onDelete: SetNull)
workspaceId Int?
@@index([id, updatedAt, projectName, runName, userName, tags, workspaceId])
@@index([searchable(ops: raw("gin_trgm_ops"))], type: Gin, name: "searchable_idx")
}

model Workspace {
id Int @id @default(autoincrement())
name String
workflows Workflow[]
id Int @id @default(autoincrement())
name String
workflows Workflow[]
@@index([id], type: Hash)
}
Expand Down Expand Up @@ -120,9 +119,42 @@ model Task {
}

model AppSettings {
id Int @id @default(autoincrement())
base_url String?
slack_webhook_url String?
slack_notification_events String[]
slack_notifications_enabled Boolean @default(false)
}
id Int @id @default(autoincrement())
base_url String?
slack_webhook_url String?
slack_notification_events String[]
slack_notifications_enabled Boolean @default(false)
}

model ComputeEnvironment {
id Int @id @default(autoincrement())
name String
description String?
is_deleted Boolean @default(false)
orchestrator_endpoint String
orchestrator_token String
executor String
ProcessKeys ProcessKeys[]
}

model Pipeline {
id String @id @unique @default(cuid())
name String
description String
github_url String
/// [ComputeEnvOverride]
compute_overrides Json?
run_params Json?
}

model ProcessKeys {
id Int @id @default(autoincrement())
processKey String
executor String
runName String
computeEnvironment ComputeEnvironment? @relation(fields: [computeEnvironmentId], references: [id], onDelete: SetNull)
computeEnvironmentId Int?
@@index([runName])
}
Loading

0 comments on commit a29255e

Please sign in to comment.