Skip to content

Commit

Permalink
Revert ""Bedrock Create""
Browse files Browse the repository at this point in the history
This reverts commit 5260999.
  • Loading branch information
dominiek committed Oct 28, 2023
1 parent 5260999 commit 7998250
Show file tree
Hide file tree
Showing 36 changed files with 207 additions and 144 deletions.
21 changes: 21 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Contribution Guide

(work in progress)

## What should live in this repo?

Something like npm plugins might become useful, but the overhead for having to think about what to separate, not to mention maintenance and dependencies has its own cost.

For now we should allow code that is potentially useful as long as it is:

- Well coded (don't toss junk in).
- Documented, at least minimally (think about people using it for the first time).
- Organized somewhere that makes sense.
- Isn't a dependency out of the box but can be opted into.
- Isn't short lived (ie. is the code likely to become obsolete as the browser landscape changes?).
- Ideally production tested.

## Potential criteria for creating an npm package

- The code has usefulness on its own outside Bedrock (?).
- The code requires multiple files or a complex structure that should be isolated from Bedrock (?).
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019 Bedrock.io, LLC

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Peachtree Platform
# Bedrock Platform

More documentation about specific services and components can be found in the following sections:

Expand Down
12 changes: 6 additions & 6 deletions deployment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ Each environment can be configured in `environments/<environment>/config.json`:
{
"gcloud": {
"envName": "staging", // - Name of the environment, e.g. staging
"bucketPrefix": "peachtree", // - Bucket prefix used for GCS bucket creation
"project": "peachtree", // - Google Cloud project id for this environment
"bucketPrefix": "bedrock-foundation", // - Bucket prefix used for GCS bucket creation
"project": "bedrock-foundation", // - Google Cloud project id for this environment
"computeZone": "us-east1-c", // - Default compute zone for project
"kubernetes": {
"clusterName": "cluster-1" // - Name of Kubernetes cluster for deployment
Expand Down Expand Up @@ -144,8 +144,8 @@ gcloud auth configure-docker
Create a Google Cloud project (in the [GC dashboard](https://console.cloud.google.com/home/dashboard)) or:

```bash
gcloud projects create peachtree-staging --name="Peachtree Staging"
gcloud config set project peachtree-staging
gcloud projects create bedrock-staging --name="Bedrock Staging"
gcloud config set project bedrock-staging
```

Configure: `environments/<environment>/config.json`.
Expand All @@ -157,7 +157,7 @@ There is a bootstrap command that automatically takes care of the remaining step
The following command takes an environment variable and Google Project ID:

```bash
bedrock cloud bootstrap staging peachtree-staging
bedrock cloud bootstrap staging bedrock-staging
```

### Directory Structure
Expand Down Expand Up @@ -426,7 +426,7 @@ We do not want to & should not check in sensitive keys into git. We therefore us
We are using env files to attach secrets to our deployment. For example to create one we would enter the key/value pairs into a text file and create it like follows.
Peachtree has the following secret commands:
Bedrock has the following secret commands:
```bash
get [environment] [name] Get Secret from cluster and store in local <secret-name>.conf file
Expand Down
4 changes: 2 additions & 2 deletions deployment/environments/production/config.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"gcloud": {
"envName": "production",
"bucketPrefix": "peachtree",
"project": "",
"bucketPrefix": "bedrock-foundation",
"project": "bedrock-foundation-production",
"computeZone": "us-east1-c",
"kubernetes": {
"clusterName": "cluster-1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ spec:
# memory: "4Gi"
env:
- name: GS_BUCKETS
value: "peachtree-uploads-backup peachtree-mongodb-backups"
value: "bedrock-foundation-uploads-backup bedrock-foundation-mongodb-backups"
- name: POSTMARK_API_KEY
value: "abc"
- name: POSTMARK_FROM
value: "admin@ptre.dev"
value: "admin@bedrock.foundation"
- name: EMAIL_ALERT
value: "admin@ptre.dev"
value: "admin@bedrock.foundation"
- name: EMAIL_HEALTH_CHECK
value: "admin@ptre.dev"
value: "admin@bedrock.foundation"
- name: ENVIRONMENT
value: "production"
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ spec:
# memory: "4Gi"
env:
- name: SOURCE_GS_BUCKET
value: "peachtree-uploads"
value: "bedrock-foundation-uploads"
- name: DESTINATION_GS_BUCKET
value: "peachtree-uploads-backup"
value: "bedrock-foundation-uploads-backup"
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ spec:
- name: MONGO_HOST
value: "mongo"
- name: MONGO_DB
value: "peachtree_production"
value: "bedrock_production"
- name: BACKUPS_GS_BUCKET
value: "peachtree-mongodb-backups"
value: "bedrock-foundation-mongodb-backups"
4 changes: 2 additions & 2 deletions deployment/environments/production/provisioning/variables.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
variable "project" {
default = ""
default = "bedrock-foundation-production"
}

variable "environment" {
Expand All @@ -19,7 +19,7 @@ variable "multi_region" {
}

variable "bucket_prefix" {
default = "peachtree-production"
default = "bedrock-production"
}

variable "cluster_name" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spec:
app: api-cli
spec:
containers:
- image: gcr.io/peachtree/peachtree-services-api-cli
- image: gcr.io/bedrock-foundation/bedrock-core-services-api-cli
imagePullPolicy: Always
name: api-cli
# resources:
Expand All @@ -26,19 +26,19 @@ spec:
- name: NODE_ENV
value: "production"
- name: MONGO_URI
value: "mongodb://mongo:27017/peachtree_production"
value: "mongodb://mongo:27017/bedrock_production"
- name: APP_URL
value: "https://ptre.dev"
value: "https://bedrock.foundation"
- name: ADMIN_EMAIL
value: "admin@ptre.dev"
value: "admin@bedrock.foundation"
- name: ADMIN_PASSWORD
value: "development.now"
- name: POSTMARK_FROM
value: "no-reply@ptre.dev"
value: "no-reply@bedrock.foundation"
- name: UPLOADS_STORE
value: "gcs"
- name: UPLOADS_GCS_BUCKET
value: "peachtree-production-uploads"
value: "bedrock-production-uploads"
# The `bedrock cloud` command in the CLI will help with
# the creation and storing of secrets for production.
- name: JWT_SECRET
Expand Down
56 changes: 36 additions & 20 deletions deployment/environments/production/services/api-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ metadata:
name: api-deployment
spec:
strategy:
type: RollingUpdate
type: RollingUpdate # New pods are added gradually, and old pods are terminated gradually
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
maxSurge: 1 # The number of pods that can be created above the desired amount of pods during an update
maxUnavailable: 1 # The number of pods that can be unavailable during the update process
selector:
matchLabels:
app: api
Expand All @@ -17,42 +17,58 @@ spec:
app: api
spec:
containers:
- image: gcr.io/peachtree/peachtree-services-api
- image: gcr.io/bedrock-foundation/bedrock-core-services-api
imagePullPolicy: Always
name: main
# resources:
# limits:
# cpu: "1000m"
# memory: "4Gi"
# requests:
# cpu: "250m"
# memory: "100Mi"
env:
- name: ENV_NAME
value: production
value: "production"
- name: NODE_ENV
value: production
value: "production"
- name: MONGO_URI
value: mongodb://mongo:27017/peachtree_production
value: "mongodb://mongo:27017/bedrock_production"
- name: APP_URL
value: https://ptre.dev
value: "https://bedrock.foundation"
- name: POSTMARK_FROM
value: no-reply@ptre.dev
value: "no-reply@bedrock.foundation"
- name: UPLOADS_STORE
value: gcs
value: "gcs"
- name: UPLOADS_GCS_BUCKET
value: peachtree-production-uploads
value: "bedrock-production-uploads"
- name: LOG_LEVEL
value: debug
value: "debug"
# The `bedrock cloud` command in the CLI will help with
# the creation and storing of secrets for production.
- name: JWT_SECRET
value: GEK7yqjO5LuCmfFyku8i5Iw6GTeNBLXP2OZC9tdF
valueFrom:
secretKeyRef:
name: secrets
key: JWT_SECRET
- name: POSTMARK_API_KEY
value: ""
valueFrom:
secretKeyRef:
name: secrets
key: POSTMARK_API_KEY
ports:
- name: http-server
containerPort: 2300
readinessProbe:
initialDelaySeconds: 5
periodSeconds: 5
timeoutSeconds: 2
failureThreshold: 2
# https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
readinessProbe: # readiness probes to know when a container is ready to start accepting traffic
initialDelaySeconds: 5 # Number of seconds after the container has started before liveness or readiness probes are initiated. Defaults to 0 seconds.
periodSeconds: 5 # How often (in seconds) to perform the probe. Default to 10 seconds
timeoutSeconds: 2 # Number of seconds after which the probe times out. Defaults to 1 second
failureThreshold: 2 # When a probe fails, Kubernetes will try failureThreshold times before giving up.
httpGet:
path: /1/status/mongodb
port: 2300
livenessProbe:
livenessProbe: # liveness probes to know when to restart a container
httpGet:
path: /1/status/mongodb
port: 2300
Expand Down
10 changes: 5 additions & 5 deletions deployment/environments/production/services/api-ingress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spec:
port:
number: 80
# rules:
# - host: api.ptre.dev
# - host: api.bedrock.foundation
# http:
# paths:
# - path: /*
Expand All @@ -28,7 +28,7 @@ spec:
# name: api-long-timeout
# port:
# number: 80
# - host: ptre.dev
# - host: bedrock.foundation
# http:
# paths:
# - path: /*
Expand All @@ -50,15 +50,15 @@ spec:
# apiVersion: v1
# kind: Service
# metadata:
# name: peachtree-api-long-timeout
# name: bedrock-api-long-timeout
# labels:
# name: peachtree-api-long-timeout
# name: bedrock-api-long-timeout
# annotations:
# cloud.google.com/backend-config: '{"ports": {"80":"long-timeout-backendconfig"}}'
# spec:
# type: NodePort
# selector:
# app: peachtree-api
# app: bedrock-api
# ports:
# - port: 80
# targetPort: 2300
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spec:
app: api-jobs
spec:
containers:
- image: gcr.io/peachtree/peachtree-services-api-jobs
- image: gcr.io/bedrock-foundation/bedrock-core-services-api-jobs
imagePullPolicy: Always
name: main
# resources:
Expand All @@ -30,8 +30,8 @@ spec:
- name: NODE_ENV
value: "production"
- name: MONGO_URI
value: "mongodb://mongo:27017/peachtree_production"
value: "mongodb://mongo:27017/bedrock_production"
- name: POSTMARK_FROM
value: "no-reply@ptre.dev"
value: "no-reply@bedrock.foundation"
- name: POSTMARK_API_KEY
value: "abc"
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spec:
app: web
spec:
containers:
- image: gcr.io/peachtree/peachtree-services-web
- image: gcr.io/bedrock-foundation/bedrock-core-services-web
imagePullPolicy: Always
name: main
# resources:
Expand All @@ -26,9 +26,9 @@ spec:
- name: NODE_ENV
value: "production"
- name: DOMAIN
value: ptre.dev
value: bedrock.foundation
- name: API_URL
value: "https://api.ptre.dev"
value: "https://api.bedrock.foundation"
ports:
- name: http-server
containerPort: 2200
10 changes: 5 additions & 5 deletions deployment/environments/production/services/web-ingress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spec:
port:
number: 80
# rules:
# - host: api.ptre.dev
# - host: api.bedrock.foundation
# http:
# paths:
# - path: /*
Expand All @@ -28,7 +28,7 @@ spec:
# name: api-long-timeout
# port:
# number: 80
# - host: ptre.dev
# - host: bedrock.foundation
# http:
# paths:
# - path: /*
Expand All @@ -50,15 +50,15 @@ spec:
# apiVersion: v1
# kind: Service
# metadata:
# name: peachtree-api-long-timeout
# name: bedrock-api-long-timeout
# labels:
# name: peachtree-api-long-timeout
# name: bedrock-api-long-timeout
# annotations:
# cloud.google.com/backend-config: '{"ports": {"80":"long-timeout-backendconfig"}}'
# spec:
# type: NodePort
# selector:
# app: peachtree-api
# app: bedrock-api
# ports:
# - port: 80
# targetPort: 2300
Expand Down
Loading

0 comments on commit 7998250

Please sign in to comment.