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

promote main #541

Merged
merged 51 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
78471cc
sentry update
hubsmoke Sep 9, 2024
2c9efb1
fix env
hubsmoke Sep 9, 2024
633a2a3
add sentry build step
hubsmoke Sep 9, 2024
b1b957a
add sentry build step
hubsmoke Sep 9, 2024
dd604cd
add sentry build step
hubsmoke Sep 10, 2024
5338763
sentry cli token
hubsmoke Sep 11, 2024
456c62b
sentry cli token
hubsmoke Sep 11, 2024
c5927e2
Merge branch 'develop' of https://github.com/desci-labs/nodes into se…
hubsmoke Sep 11, 2024
34148db
dont autorun sentry on yarn build
hubsmoke Sep 15, 2024
bc39c03
Merge branch 'develop' of https://github.com/desci-labs/nodes into se…
hubsmoke Sep 16, 2024
3bcf796
run sentry?
hubsmoke Sep 16, 2024
8c05554
echo sentrytoken to env for build
hubsmoke Sep 16, 2024
6594d3c
fix newline
hubsmoke Sep 16, 2024
2c3fddd
add sentry token to inner env
hubsmoke Sep 16, 2024
8c14ce6
test build
hubsmoke Sep 16, 2024
ddc7532
test build
hubsmoke Sep 16, 2024
d3c4daa
fix check on nested fields for filtering
kadamidev Sep 20, 2024
bce879b
Merge pull request #506 from desci-labs/nesting-fix
kadamidev Sep 20, 2024
0137f4c
add community control plane(admin) routes, control plane route data v…
shadrach-tayo Sep 21, 2024
d498f8f
nodeslib: force sep eth chainid in CACAO unless overridden
m0ar Sep 23, 2024
2796d0c
Merge pull request #507 from desci-labs/m0ar/nodeslib-force-cacao-cha…
m0ar Sep 23, 2024
ae42753
clean up
shadrach-tayo Sep 23, 2024
2d6afe0
sanity check before attempting to retrieve automerge url doc
shadrach-tayo Sep 23, 2024
5e4fffc
Merge pull request #508 from desci-labs/fix/sanitize-automergeurl
shadrach-tayo Sep 23, 2024
4179629
implement community update api
shadrach-tayo Sep 23, 2024
fe3a28e
add and update attestation api
shadrach-tayo Sep 23, 2024
eb1fc1b
add and remove community member apis
shadrach-tayo Sep 23, 2024
c40c973
implement apis for adding/removing community required attestations
shadrach-tayo Sep 24, 2024
42c5f7c
sanitize output for email
hubsmoke Sep 24, 2024
8a3ffc6
clean up
shadrach-tayo Sep 24, 2024
164b56e
ceramic: bump nodes to 6.5.0
m0ar Sep 24, 2024
ba0dbac
Merge pull request #512 from desci-labs/m0ar/ceramic-6.5.0
m0ar Sep 24, 2024
80cb3be
Merge pull request #509 from desci-labs/tay/community-admin
shadrach-tayo Sep 24, 2024
82b1782
server: include stream & dpid with other public info in checkNodeAccess
m0ar Sep 24, 2024
1889bd5
Merge pull request #513 from desci-labs/m0ar/public-info-in-access-check
m0ar Sep 24, 2024
1613295
Merge pull request #511 from desci-labs/sanitize-outputs
hubsmoke Sep 24, 2024
04ba63e
fix: Orcid Nodes dataset work record dpid path, clear orcid work reco…
shadrach-tayo Sep 24, 2024
85e042d
adjust match filter to handle arrays
kadamidev Sep 25, 2024
ff596ab
Merge pull request #514 from desci-labs/fix/orcid-works-faulty-datase…
hubsmoke Sep 25, 2024
643e9c6
Merge pull request #528 from desci-labs/filter-adjustments
hubsmoke Sep 25, 2024
56ee606
ceramic: enable metrics scraping endpoiunts, fixed dev deployment str…
m0ar Sep 27, 2024
06f310a
Merge pull request #533 from desci-labs/m0ar/ceramic-metrics
m0ar Sep 27, 2024
90af1fe
fix radar query for ceramic streams
hubsmoke Sep 27, 2024
5313c5b
Merge pull request #534 from desci-labs/fix-submit-dpid
hubsmoke Sep 27, 2024
f20e5c0
Merge pull request #476 from desci-labs/sentry-update
hubsmoke Sep 27, 2024
7995fc2
update sentry tracing to log db and http reqs in sentry
hubsmoke Sep 28, 2024
1d1ea7f
Merge pull request #536 from desci-labs/sentry-traces
hubsmoke Sep 28, 2024
32044b5
apply profile sample rate
hubsmoke Sep 30, 2024
ecc85e1
Merge pull request #538 from desci-labs/sentry-update-2
hubsmoke Sep 30, 2024
2d8146a
fix build
hubsmoke Sep 30, 2024
6ac8892
fix build2
hubsmoke Sep 30, 2024
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
7 changes: 4 additions & 3 deletions .ceramicDev.config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"anchor": { },
"anchor": {},
"http-api": {
"cors-allowed-origins": [
".*"
Expand All @@ -16,8 +16,8 @@
"log-level": 2
},
"metrics": {
"metrics-exporter-enabled": false,
"metrics-port": 9090
"prometheus-exporter-enabled": true,
"prometheus-exporter-port": 9464
},
"network": {
"name": "inmemory"
Expand All @@ -33,3 +33,4 @@
"models": []
}
}

10 changes: 10 additions & 0 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ env:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
CONTAINER_IMAGE: desci-server
DOCKER_BUILDKIT: 1
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}

jobs:
build-and-test:
Expand Down Expand Up @@ -55,6 +56,15 @@ jobs:
echo "{\"proxies\":[{\"address\":\"\"}]}" > desci-server/src/desci-contracts-config/unknown-research-object.json
echo "{\"proxies\":[{\"address\":\"\"}]}" > desci-server/src/desci-contracts-config/unknown-dpid.json

- name: Set up Sentry CLI
run: |
npm install -g @sentry/cli
sentry-cli --version
sentry-cli login --auth-token $SENTRY_AUTH_TOKEN
# append to .env
echo -e "\nSENTRY_AUTH_TOKEN=$SENTRY_AUTH" >> desci-server/.env
cd desci-server && yarn build

- name: Run tests
run: |
cd desci-server && export DOCKER_BUILDKIT=1 && yarn --ignore-engines && yarn test
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/build-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ env:
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
CONTAINER_IMAGE: desci-server
DOCKER_BUILDKIT: 1

Expand Down Expand Up @@ -57,6 +58,14 @@ jobs:
echo "{\"proxies\":[{\"address\":\"\"}]}" > desci-server/src/desci-contracts-config/unknown-research-object.json
echo "{\"proxies\":[{\"address\":\"\"}]}" > desci-server/src/desci-contracts-config/unknown-dpid.json

- name: Set up Sentry CLI
run: |
npm install -g @sentry/cli
sentry-cli --version
sentry-cli login --auth-token $SENTRY_AUTH_TOKEN
# append to .env
echo -e "\nSENTRY_AUTH_TOKEN=$SENTRY_AUTH" >> desci-server/.env

- name: Run tests
run: |
cd desci-server && export DOCKER_BUILDKIT=1 && yarn --ignore-engines && yarn test
Expand Down Expand Up @@ -113,6 +122,14 @@ jobs:
echo "{\"proxies\":[{\"address\":\"\"}]}" > desci-server/src/desci-contracts-config/unknown-research-object.json
echo "{\"proxies\":[{\"address\":\"\"}]}" > desci-server/src/desci-contracts-config/unknown-dpid.json

- name: Set up Sentry CLI
run: |
npm install -g @sentry/cli
sentry-cli --version
sentry-cli login --auth-token $SENTRY_AUTH_TOKEN
# append to .env
echo -e "\nSENTRY_AUTH_TOKEN=$SENTRY_AUTH" >> desci-server/.env

- name: Build and tag the image (DEV)
if: github.ref == 'refs/heads/develop'
run: |
Expand Down
58 changes: 36 additions & 22 deletions ceramic-k8s/ceramic_deployment_dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ spec:
matchLabels:
App: JsCeramicDev
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
type: Recreate
template:
metadata:
annotations:
Expand All @@ -41,14 +38,18 @@ spec:
App: JsCeramicDev
spec:
containers:
- image: ceramicnetwork/js-ceramic:6.4.0
# Enables a fix allowing us to heal dropped anchors on genesis commits:
# https://github.com/ceramicnetwork/js-ceramic/pull/3280
- image: ceramicnetwork/js-ceramic:6.6.0-rc.0
name: js-ceramic-dev
command: ["/bin/bash", "-c"]
args:
- echo "SOURCING ENV"; source /vault/secrets/config; ./packages/cli/bin/ceramic.js daemon --config daemon.config.json;
ports:
- containerPort: 7007
name: http-api
- containerPort: 9464
name: metrics
resources:
limits:
cpu: 2
Expand All @@ -70,9 +71,38 @@ spec:
port: http-api
failureThreshold: 60
periodSeconds: 1

serviceAccountName: "vault-auth"
---
apiVersion: v1
kind: Service
metadata:
name: js-ceramic-dev-service-internal
labels:
App: JsCeramicDev
spec:
type: ClusterIP
selector:
App: JsCeramicDev
ports:
- name: metrics
port: 9464
targetPort: metrics
---
apiVersion: v1
kind: Service
metadata:
name: public-js-ceramic-dev-service
labels:
App: JsCeramicDev
spec:
type: LoadBalancer
selector:
App: JsCeramicDev
ports:
- protocol: TCP
port: 80
targetPort: http-api
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
Expand All @@ -91,19 +121,3 @@ spec:
name: public-js-ceramic-dev-service
port:
number: 80
---
apiVersion: v1
kind: Service
metadata:
name: public-js-ceramic-dev-service
labels:
App: JsCeramicDev
spec:
type: LoadBalancer
selector:
App: JsCeramicDev
ports:
- protocol: TCP
name: http
port: 80
targetPort: 7007
52 changes: 34 additions & 18 deletions ceramic-k8s/ceramic_deployment_prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ spec:
App: JsCeramicProd
spec:
containers:
- image: ceramicnetwork/js-ceramic:6.4.0
- image: ceramicnetwork/js-ceramic:6.5.0
name: js-ceramic-prod
command: ["/bin/bash", "-c"]
volumeMounts:
Expand All @@ -73,6 +73,8 @@ spec:
ports:
- containerPort: 7007
name: http-api
- containerPort: 9464
name: metrics
resources:
limits:
cpu: 2
Expand Down Expand Up @@ -107,9 +109,39 @@ spec:
- name: ceramic-prod-persistent-storage
persistentVolumeClaim:
claimName: ceramic-prod-persistent-storage-pvc

serviceAccountName: "vault-auth"
---
apiVersion: v1
kind: Service
metadata:
name: js-ceramic-prod-service-internal
labels:
App: JsCeramicProd
spec:
type: ClusterIP
selector:
App: JsCeramicProd
ports:
- name: metrics
port: 9464
targetPort: metrics
---
apiVersion: v1
kind: Service
metadata:
name: public-js-ceramic-prod-service
labels:
App: JsCeramicProd
spec:
type: LoadBalancer
selector:
App: JsCeramicProd
ports:
- protocol: TCP
name: http
port: 80
targetPort: http-api
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
Expand All @@ -128,19 +160,3 @@ spec:
name: public-js-ceramic-prod-service
port:
number: 80
---
apiVersion: v1
kind: Service
metadata:
name: public-js-ceramic-prod-service
labels:
App: JsCeramicProd
spec:
type: LoadBalancer
selector:
App: JsCeramicProd
ports:
- protocol: TCP
name: http
port: 80
targetPort: 7007
7 changes: 1 addition & 6 deletions desci-repo/src/controllers/nodes/documents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,13 @@ export const createNodeDocument = async function (req: Request, res: Response) {
export const getLatestNodeManifest = async function (req: Request, res: Response) {
logger.info({ params: req.params }, 'START [getLatestNodeManifest]');
try {
console.log('[getLatestNodeManifest]', req.params);
logger.info({ params: req.params }, '[getLatestNodeManifest]');
if (!req.params.uuid) {
res.status(400).send({ ok: false, message: 'Invalid data' });
return;
}

const { uuid } = req.params;

// const queryResult = await pool.query('SELECT * FROM nodes WHERE uuid = $1', [uuid]);
// console.log('user:', queryResult.rows[0]);

logger.info('[getLatestNodeManifest]', { uuid });
const node = await findNodeByUuid(uuid);
logger.trace('[getLatestNodeManifest::node]', { node });

Expand Down
3 changes: 3 additions & 0 deletions desci-server/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ server.log
repo-tmp

queries.sql

# Sentry Config File
.sentryclirc
9 changes: 6 additions & 3 deletions desci-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"script:seed-social-data": "debug=* node --no-warnings --enable-source-maps --loader ts-node/esm ./src/scripts/seed-social-data.ts",
"script:DESTRUCTIVE-clear-social-data": "debug=* node --no-warnings --enable-source-maps --loader ts-node/esm ./src/scripts/DESTRUCTIVE-clear-social-data.ts",
"script:seed-community-member": "debug=* node --no-warnings --enable-source-maps --loader ts-node/esm ./src/scripts/seed-community-members.ts",
"build": "rimraf dist && tsc && yarn copy-files",
"build": "rimraf dist && tsc && yarn copy-files; if [ \"$SENTRY_AUTH_TOKEN\" ]; then yarn sentry:sourcemaps; else echo 'SENTRY_AUTH_TOKEN not set, sourcemaps will not upload'; fi",
"copy-files": "copyfiles -u 1 src/**/*.cjs dist/",
"generate": "npx prisma generate",
"migrate:local": "DATABASE_URL=postgresql://walter:white@localhost:5433/boilerplate npx prisma migrate dev",
Expand All @@ -50,7 +50,8 @@
"docker:prod": "../dockerProd.sh",
"podman:dev": "podman-compose --file docker-compose.yml --file docker-compose.dev.yml up --build",
"email-dev": "email dev --dir ./src/templates/emails --port 3777",
"check-deps": "npx npm-check"
"check-deps": "npx npm-check",
"sentry:sourcemaps": "sentry-cli sourcemaps inject --org desci-labs --project nodes-backend ./dist && sentry-cli sourcemaps upload --org desci-labs --project nodes-backend ./dist && echo 'Sentry sourcemaps uploaded'"
},
"dependencies": {
"@automerge/automerge-repo": "^1.0.19",
Expand All @@ -68,7 +69,9 @@
"@prisma/client": "4.10.1",
"@react-email/components": "0.0.15",
"@sendgrid/mail": "^7.7.0",
"@sentry/node": "^7.12.0",
"@sentry/cli": "^2.35.0",
"@sentry/node": "^8.29.0",
"@sentry/profiling-node": "^8.32.0",
"@sentry/tracing": "^7.12.0",
"@types/lodash-es": "^4.17.12",
"@types/mkdirp": "^1.0.2",
Expand Down
3 changes: 2 additions & 1 deletion desci-server/prisma/schema.prisma
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
generator client {
provider = "prisma-client-js"
provider = "prisma-client-js"
previewFeatures = ["tracing"]
}

datasource db {
Expand Down
Loading
Loading