-
Notifications
You must be signed in to change notification settings - Fork 4
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
Use Kittyhawk for Deployment Config #358
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
2860eee
:tada: Initial set-up
joyliu-q ece5d04
:arrow_up: Upgrade Kraken & Regen CI
joyliu-q 904bbc5
:art: Swap DOMAIN -> DOMAINS env
joyliu-q c8d9bce
Merge branch 'master' of https://github.com/pennlabs/penn-courses int…
joyliu-q a6b7bc2
:arrow_up: Scale up
joyliu-q c5b58c8
Merge branch 'master' of https://github.com/pennlabs/penn-courses int…
joyliu-q cf9d403
:arrow_up: Upgrade deps & copy over package.json
joyliu-q 167868b
:art: Uniform cdkaction package.json
joyliu-q 554c6ca
:arrow_up: Bump deps
joyliu-q f7c6497
:bug: Working version of construct
joyliu-q 7465cd4
Merge branch 'master' into feature/update-to-kittyhawk
joyliu-q 81afe06
Merge branch 'master' into feature/update-to-kittyhawk
joyliu-q 4ea78f2
Merge branch 'master' of https://github.com/pennlabs/penn-courses int…
joyliu-q 76c0ef4
:arrow_down: Scale down backend to 3
joyliu-q b1e9fce
:arrow_up: Bump Kittyhawk
joyliu-q 22a66b8
:fire: Bye jest
joyliu-q File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
*.d.ts | ||
*.js | ||
node_modules | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
language: typescript | ||
app: node main.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
import { Construct } from 'constructs'; | ||
import { App } from 'cdk8s'; | ||
import { CronJob, DjangoApplication, PennLabsChart, ReactApplication, RedisApplication } from '@pennlabs/kittyhawk'; | ||
|
||
const cronTime = require('cron-time-generator'); | ||
|
||
export class MyChart extends PennLabsChart { | ||
constructor(scope: Construct) { | ||
super(scope); | ||
|
||
const backendImage = 'pennlabs/penn-courses-backend'; | ||
const secret = 'penn-courses'; | ||
|
||
new RedisApplication(this, 'redis', { deployment: { tag: '4.0' } }); | ||
|
||
new DjangoApplication(this, 'celery', { | ||
deployment: { | ||
image: backendImage, | ||
secret: secret, | ||
cmd: ['celery', 'worker', '-A', 'PennCourses', '-Q', 'alerts,celery', '-linfo'], | ||
}, | ||
djangoSettingsModule: 'PennCourses.settings.production', | ||
}); | ||
|
||
new DjangoApplication(this, 'backend', { | ||
deployment: { | ||
image: backendImage, | ||
secret: secret, | ||
cmd: ['celery', 'worker', '-A', 'PennCourses', '-Q', 'alerts,celery', '-linfo'], | ||
replicas: 3, | ||
env: [{ name: 'PORT', value: '80' }], | ||
}, | ||
djangoSettingsModule: 'PennCourses.settings.production', | ||
ingressProps: { | ||
annotations: { ['ingress.kubernetes.io/content-security-policy']: "frame-ancestors 'none';" }, | ||
}, | ||
domains: [{ host: 'penncourseplan.com', paths: ["/api", "/admin", "/accounts", "/assets"] }, | ||
{ host: 'penncoursealert.com', paths: ["/api", "/admin", "/accounts", "/assets", "/webhook"] }, | ||
{ host: 'penncoursereview.com', paths: ["/api", "/admin", "/accounts", "/assets"] }], | ||
}); | ||
|
||
new ReactApplication(this, 'landing', { | ||
deployment: { | ||
image: 'pennlabs/pcx-landing', | ||
}, | ||
domain: { host: 'penncourses.org', paths: ['/'] }, | ||
}); | ||
|
||
new ReactApplication(this, 'plan', { | ||
deployment: { | ||
image: 'pennlabs/pcp-frontend', | ||
}, | ||
domain: { host: 'penncourseplan.org', paths: ['/'] }, | ||
}); | ||
|
||
new ReactApplication(this, 'alert', { | ||
deployment: { | ||
image: 'pennlabs/pca-frontend', | ||
}, | ||
domain: { host: 'penncoursealert.org', paths: ['/'] }, | ||
}); | ||
|
||
new ReactApplication(this, 'review', { | ||
deployment: { | ||
image: 'pennlabs/pcr-frontend', | ||
}, | ||
domain: { host: 'penncoursereview.org', paths: ['/'] }, | ||
}); | ||
|
||
new CronJob(this, 'load-courses', { | ||
schedule: cronTime.everyDayAt(3), | ||
image: backendImage, | ||
secret: secret, | ||
cmd: ['python', 'manage.py', 'registrarimport'], | ||
}); | ||
|
||
new CronJob(this, 'report-stats', { | ||
schedule: cronTime.everyDayAt(20), | ||
image: backendImage, | ||
secret: secret, | ||
cmd: ['python', 'manage.py', 'alertstats', '1', '--slack'], | ||
}); | ||
|
||
} | ||
} | ||
|
||
const app = new App(); | ||
new MyChart(app); | ||
app.synth(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"name": "k8s", | ||
"version": "1.0.0", | ||
"main": "main.js", | ||
"types": "main.ts", | ||
"license": "Apache-2.0", | ||
"private": true, | ||
"scripts": { | ||
"import": "cdk8s import", | ||
"synth": "cdk8s synth", | ||
"compile": "tsc", | ||
"watch": "tsc -w", | ||
"build": "npm run compile && npm run synth", | ||
"upgrade": "npm i cdk8s@latest cdk8s-cli@latest", | ||
"upgrade:next": "npm i cdk8s@next cdk8s-cli@next" | ||
}, | ||
"dependencies": { | ||
"@pennlabs/kittyhawk": "^1.1.4", | ||
"cdk8s": "^2.2.63", | ||
"constructs": "^10.0.119" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "^26.0.24", | ||
"@types/node": "^14.18.12", | ||
"jest": "^26.6.3", | ||
"ts-jest": "^26.5.6", | ||
"typescript": "^4.6.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"compilerOptions": { | ||
"alwaysStrict": true, | ||
"charset": "utf8", | ||
"declaration": true, | ||
"experimentalDecorators": true, | ||
"inlineSourceMap": true, | ||
"inlineSources": true, | ||
"lib": [ | ||
"es2016" | ||
], | ||
"module": "CommonJS", | ||
"noEmitOnError": true, | ||
"noFallthroughCasesInSwitch": true, | ||
"noImplicitAny": true, | ||
"noImplicitReturns": true, | ||
"noImplicitThis": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"resolveJsonModule": true, | ||
"strict": true, | ||
"strictNullChecks": true, | ||
"strictPropertyInitialization": true, | ||
"stripInternal": true, | ||
"target": "ES2017" | ||
}, | ||
"include": [ | ||
"**/*.ts" | ||
], | ||
"exclude": [ | ||
"node_modules" | ||
] | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the version used by
cdkactions
. Using a3.3.x
version would cause some products (e.g. penn-clubs to break)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.