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 #322

Merged
merged 209 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
209 commits
Select commit Hold shift + click to select a range
7b52149
update dpid url
shadrach-tayo Mar 22, 2024
2e8dbda
add uuid to contributors in RO models
kadamidev Mar 25, 2024
d6c0264
bump models version in package.json
kadamidev Mar 25, 2024
92d954e
test fix
kadamidev Mar 25, 2024
c962ade
fix ro crate transformer tests
kadamidev Mar 25, 2024
0fb1bc4
transformer test fixes
kadamidev Mar 25, 2024
b642616
contributor id optional for backwards compatability
kadamidev Mar 25, 2024
22bb602
Merge pull request #259 from desci-labs/contributors-model-update
hubsmoke Mar 25, 2024
b878dd1
return orcid on profile search for autofilling
kadamidev Mar 25, 2024
aecfda3
add search nodes profiles by orcid functionality
kadamidev Mar 25, 2024
88221ef
Merge pull request #260 from desci-labs/contributor-api-adj
kadamidev Mar 25, 2024
a5361da
ensure consistent orcid search format
kadamidev Mar 25, 2024
c774225
ensure orcids are correctly added in hyphenated format when adding co…
kadamidev Mar 25, 2024
6804457
fix search user nodes profile via orcid
kadamidev Mar 25, 2024
9766814
Merge pull request #261 from desci-labs/contributor-api-adj
kadamidev Mar 25, 2024
dfec5c5
Merge branch 'develop' into dpid-url
shadrach-tayo Mar 25, 2024
7b86900
fix share links gen for contributor invites
kadamidev Mar 26, 2024
8521620
fix revoking share codes for contributors linked with nodes profile
kadamidev Mar 26, 2024
54b7460
fix get share code for contribution helper
kadamidev Mar 26, 2024
870e132
Merge pull request #262 from desci-labs/contributor-api-adj
kadamidev Mar 26, 2024
6359927
update contributor invite template to include correct env url, non ha…
kadamidev Mar 26, 2024
443e73a
Merge pull request #263 from desci-labs/contributor-api-adj
kadamidev Mar 26, 2024
0bf39b3
contracts: remove unused hardhat artifacts
m0ar Mar 25, 2024
f72b25d
nodes-lib: rework config system, allow passing signer
m0ar Mar 26, 2024
1f8e1b2
server: disable public ref mirroring flow in publish controller
m0ar Mar 27, 2024
9bf1b60
nodes-lib: be vocal about setting config
m0ar Mar 27, 2024
880115e
nodes-lib: publish works with web3provider+metamask
m0ar Mar 28, 2024
5cbe178
server: seed dev db with api key for tests
m0ar Mar 28, 2024
7feb8a6
nodes-lib: switch web3provider interface for signer
m0ar Mar 28, 2024
10e7138
update models
shadrach-tayo Apr 1, 2024
4934589
Merge branch 'develop' into dpid-url
shadrach-tayo Apr 1, 2024
4f12187
update be-node-dev.sh install script to work on mac os
shadrach-tayo Apr 2, 2024
090651a
update script and desci-repo node version
shadrach-tayo Apr 2, 2024
0663991
fix: server crash on browser request hit (node 18.17.0) upgrade to no…
shadrach-tayo Apr 2, 2024
66e0fc2
add support for code highlights to comments api schema, update model
shadrach-tayo Apr 2, 2024
7a98457
bump desci-models version to 0.2.6-rc1
shadrach-tayo Apr 2, 2024
afc1b0b
fixes for macos setup issues
shadrach-tayo Apr 3, 2024
80c4bc1
revert desci-repo node version
shadrach-tayo Apr 3, 2024
6ea453b
change get node contributions route to post to prevent issues with js…
kadamidev Apr 3, 2024
c592500
Merge pull request #266 from desci-labs/contributor-api-change
kadamidev Apr 3, 2024
e5a39cc
first implemention of single node locking with redis
shadrach-tayo Apr 3, 2024
168bfa0
free all active locks on server stop signal
shadrach-tayo Apr 4, 2024
304ced1
free locks on uncaughtexceptions
shadrach-tayo Apr 4, 2024
54761b9
contracts: regenerate outputs, move deps to devDeps to reduce footpri…
m0ar Apr 3, 2024
3a13539
contracts: fix local contract deployments
m0ar Apr 4, 2024
684dea6
nodes-lib: custom siwe cacao authentication for plain signers
m0ar Apr 4, 2024
ddb9c94
server: associateOrcidWallet returns 202 instead of 400 if already as…
m0ar Apr 4, 2024
8e5d08f
server: seed dev db with api key for noreply user
m0ar Apr 4, 2024
89c36e0
contracts: use ResearchObjectMigrated instead of ResearchObjectV2 in …
m0ar Apr 4, 2024
b4d3291
nodeslib: blockchain related fixes
m0ar Apr 4, 2024
35adf3c
add endpoint to get authed users contributions
kadamidev Apr 4, 2024
2eb6c67
Merge pull request #269 from desci-labs/contributor-api-change
kadamidev Apr 4, 2024
4547369
reversion fix
kadamidev Apr 4, 2024
fb20f3c
Merge pull request #270 from desci-labs/contributor-api-change
kadamidev Apr 4, 2024
da21bb1
hook up bootstrapCeramic.sh to dockerDev.sh
m0ar Apr 4, 2024
f8509a5
build fix
kadamidev Apr 4, 2024
d183cff
Merge pull request #271 from desci-labs/contributor-api-change
kadamidev Apr 4, 2024
5fec94e
fix verification logic to also allow verif via userid added
kadamidev Apr 4, 2024
ac07c96
Merge pull request #272 from desci-labs/contributor-api-change
kadamidev Apr 4, 2024
378b553
prevent route collision
kadamidev Apr 5, 2024
20f98eb
Merge pull request #273 from desci-labs/contributor-api-change
kadamidev Apr 5, 2024
378278a
contracts: fix npm package to allow use under node10 resolution in we…
m0ar Apr 8, 2024
7795cee
nodeslib: use new contract package
m0ar Apr 8, 2024
417c504
nicer warning on env misconfiguration in bootstrapCeramic.sh
m0ar Apr 8, 2024
ef11457
nodeslib: try to pull auth token from localstorage if running in brow…
m0ar Apr 8, 2024
8b137a5
contracts: split package build and contract compilation for CI, tidy …
m0ar Apr 9, 2024
8b9c67b
Merge pull request #268 from desci-labs/m0ar/nodeslib-web-publish
m0ar Apr 9, 2024
32f8ada
Merge branch 'develop' into dpid-url
shadrach-tayo Apr 9, 2024
b48e141
Merge pull request #264 from desci-labs/dpid-url
shadrach-tayo Apr 9, 2024
7b46468
Merge pull request #267 from desci-labs/fix/publish-race
shadrach-tayo Apr 10, 2024
2282cd3
local dep fixes
kadamidev Apr 10, 2024
771d6ff
enhance publish worker logs and add new env for MAX_LOCK_TIME
shadrach-tayo Apr 11, 2024
b16b8f8
Merge pull request #275 from desci-labs/publish-logs
shadrach-tayo Apr 11, 2024
882713f
add env to mute publish worker logs
kadamidev Apr 11, 2024
afb5b93
wip fix update
kadamidev Apr 11, 2024
cb09005
fix handling of processes to terminate correctly and allow proper sig…
kadamidev Apr 12, 2024
968a69d
dont terminate on exceptions
kadamidev Apr 12, 2024
8ca17bd
lib: enable early exit from publishing if signer address is wrong
m0ar Apr 12, 2024
73919c9
fix update contributors endpoint, disable sending of emails in local dev
kadamidev Apr 12, 2024
708c226
lib: enable ceramic auth directly with authenticated DID session
m0ar Apr 12, 2024
9b3e3ac
merge conflicts
kadamidev Apr 12, 2024
4112080
merge resolutions
kadamidev Apr 12, 2024
24bc482
Merge pull request #276 from desci-labs/contrib-fixes
kadamidev Apr 12, 2024
e390a99
lib: fix failing tests and browser detection
m0ar Apr 12, 2024
609f73e
lib: test did derivation from signer, fix flaky test
m0ar Apr 12, 2024
3dd117b
lib: re-export resource getter from codex-lib
m0ar Apr 12, 2024
1086552
ceramic: prod node deployment
m0ar Apr 15, 2024
db08e34
ceramic: add health probes to dev node
m0ar Apr 15, 2024
75aa48f
revert nodemon desci-repo config
kadamidev Apr 15, 2024
3aa3119
Merge pull request #279 from desci-labs/local-dev-conf-rev
kadamidev Apr 15, 2024
75a67a1
Merge pull request #277 from desci-labs/m0ar/lib-token-ownership-check
m0ar Apr 16, 2024
66c1a9a
Add reverse-proxy-service for hiding sensitive endpoints
m0ar Apr 9, 2024
c13f960
reverse-proxy: mini tsconfig fix
m0ar Apr 9, 2024
a8d3c5a
reverse-proxy: change to unused port, add single env kubernetes deplo…
m0ar Apr 9, 2024
3414095
reverse-proxy: add to root readme
m0ar Apr 9, 2024
22aa391
reverse-proxy: fix bug on cleanbuild in dockerfile prod stage
m0ar Apr 9, 2024
631fd5e
reverse-proxy: build & deploy for dev/staging/prod
m0ar Apr 16, 2024
72fab4a
reverse-proxy: nerf to 1 replica in dev/staging
m0ar Apr 16, 2024
0cefed1
enrich fetching users collabed nodes endpoint to return more data
kadamidev Apr 16, 2024
10e0419
type fixes
kadamidev Apr 16, 2024
2395429
Merge pull request #280 from desci-labs/improve-api
kadamidev Apr 16, 2024
058f412
reverse-proxy: typo in workflow container tag
m0ar Apr 17, 2024
5be4f56
Merge pull request #274 from desci-labs/m0ar/reverse-proxy-service
m0ar Apr 17, 2024
c3bc8b4
wip: protected attestations feature
shadrach-tayo Apr 17, 2024
8f434d9
Merge branch 'develop' into feat/protected-claims
shadrach-tayo Apr 17, 2024
b8d7616
implement protected attestations and claims api
shadrach-tayo Apr 17, 2024
fc92e59
Merge pull request #278 from desci-labs/m0ar/ceramic-prod-deployment
m0ar Apr 17, 2024
4628cc1
reverse-proxy: hotfix vault path for secrets
m0ar Apr 17, 2024
fce4687
Merge pull request #281 from desci-labs/m0ar/hotfix-proxy-vault-injec…
m0ar Apr 17, 2024
37616ae
reverse-proxy: hotfix-proxy-image
m0ar Apr 17, 2024
ffc290f
Merge pull request #282 from desci-labs/m0ar/hotfix-proxy-image
m0ar Apr 17, 2024
1ee4587
schema update, community member seed script, update seed data and api…
shadrach-tayo Apr 17, 2024
a1de48a
fix: test
shadrach-tayo Apr 17, 2024
fe7a505
reverse-proxy: fix broken between ingress and load balancer
m0ar Apr 17, 2024
e7f07bd
Merge pull request #284 from desci-labs/m0ar/hotfix-ingress-loadbalancer
m0ar Apr 17, 2024
5b670c3
fix: invalid input
shadrach-tayo Apr 17, 2024
539e63e
update tests
shadrach-tayo Apr 17, 2024
2736ecb
fix: clashing test auth tokens
shadrach-tayo Apr 17, 2024
5bb3e19
add negative tests
shadrach-tayo Apr 17, 2024
2660b2c
Merge pull request #283 from desci-labs/feat/protected-claims
shadrach-tayo Apr 17, 2024
a106655
remove missing env from k8s config
shadrach-tayo Apr 17, 2024
f50c24a
Merge branch 'develop' into fix/env
shadrach-tayo Apr 17, 2024
a9d43db
Merge pull request #285 from desci-labs/fix/env
shadrach-tayo Apr 17, 2024
abe5351
add controller for retrieving nodes shared with a user
kadamidev Apr 17, 2024
c74a2e4
add route for retrieval
kadamidev Apr 17, 2024
2b5695f
reverse-proxy: add support for washing secrets in response bodies
m0ar Apr 18, 2024
5dd4bdf
Merge pull request #286 from desci-labs/m0ar/proxy-wash-response-secrets
m0ar Apr 18, 2024
ed475f9
nodelib: support staging environment with dev contracts
m0ar Apr 18, 2024
450a68c
nodelib: update readme
m0ar Apr 18, 2024
24fc5b4
Merge pull request #288 from desci-labs/collection-improvements
kadamidev Apr 18, 2024
36051ee
feat: orcid post record service method impl
shadrach-tayo Apr 21, 2024
42d6111
feat: implement orcid api service for writing and updating work records
shadrach-tayo Apr 21, 2024
5e9f1a4
add verified protected claims only to orcid profile
shadrach-tayo Apr 21, 2024
b379542
add fallback orcid domain for test workflow
shadrach-tayo Apr 21, 2024
451d203
remove test skips
shadrach-tayo Apr 21, 2024
6b049f8
Merge pull request #289 from desci-labs/feat/orcid-profile-integration
shadrach-tayo Apr 22, 2024
691996c
fix: undefined putcode included in orcid api data
shadrach-tayo Apr 22, 2024
9c44231
fix: orcid xml schema
shadrach-tayo Apr 23, 2024
2e60ba5
Merge pull request #290 from desci-labs/quick-fix
shadrach-tayo Apr 23, 2024
08d03a4
fix: prevent storing duplicate orcid authToken for same user, update…
shadrach-tayo Apr 23, 2024
e39f8c9
Merge pull request #291 from desci-labs/orcid-auth
shadrach-tayo Apr 23, 2024
a71c870
fix: hanging tests
shadrach-tayo Apr 23, 2024
fee2e03
Revert "Orcid authtoken refresh"
shadrach-tayo Apr 23, 2024
0e3e887
Merge pull request #292 from desci-labs/revert-291-orcid-auth
shadrach-tayo Apr 23, 2024
5503833
Merge branch 'develop' into orcid-auth
shadrach-tayo Apr 23, 2024
d05d569
Merge pull request #293 from desci-labs/orcid-auth
shadrach-tayo Apr 23, 2024
e5eb8d6
restore deleted refresh token logic
shadrach-tayo Apr 23, 2024
668c264
Merge pull request #294 from desci-labs/fix-revert
shadrach-tayo Apr 23, 2024
da2b7de
fix port
kadamidev Apr 24, 2024
f019824
restore multiple orcid auth token insertion, query auth token in des…
shadrach-tayo Apr 24, 2024
a87d65d
Merge pull request #296 from desci-labs/auth-token
shadrach-tayo Apr 24, 2024
eab7d27
use draft manifests when available for shared nodes
kadamidev Apr 26, 2024
1aeb10e
Merge branch 'develop' of github.com:desci-labs/nodes into collection…
kadamidev Apr 26, 2024
d66d6d5
Merge pull request #297 from desci-labs/collection-improvements
kadamidev Apr 26, 2024
473cfb0
include DPID_URL_OVERRIDE in k8s config env
shadrach-tayo Apr 29, 2024
b1462ea
log refresh token error response
shadrach-tayo Apr 29, 2024
2d2d6b0
send email to notifiy members of protected community attestation whe…
shadrach-tayo Apr 30, 2024
56c2b02
claiming an attestation on a newer version of the node should skip al…
shadrach-tayo Apr 30, 2024
edb77da
test passes
shadrach-tayo Apr 30, 2024
7230ff0
Merge pull request #287 from desci-labs/m0ar/nodelib-staging-env
m0ar May 5, 2024
419d544
Merge pull request #295 from desci-labs/dep-fixes
m0ar May 5, 2024
a70e520
fix: auth token refresh request not correct, duplicate claim external…
shadrach-tayo May 7, 2024
6f07593
update orcid record when claim is unverified
shadrach-tayo May 7, 2024
aba3f67
Merge pull request #299 from desci-labs/desci-foundation
shadrach-tayo May 7, 2024
4b28a7a
Merge branch 'develop' into debug/orcid-auth
shadrach-tayo May 7, 2024
c161ea9
auth refresh token debug
shadrach-tayo May 7, 2024
68e168d
auth refresh token debug
shadrach-tayo May 7, 2024
295e5fa
Merge branch 'develop' into orcid-refresh-debug
shadrach-tayo May 7, 2024
8c0d5f5
Merge pull request #303 from desci-labs/orcid-refresh-debug
shadrach-tayo May 7, 2024
bfc4af6
Merge branch 'develop' into debug/orcid-auth
shadrach-tayo May 7, 2024
c18514e
more debug statements to protected
shadrach-tayo May 8, 2024
e931fe6
Merge pull request #298 from desci-labs/debug/orcid-auth
shadrach-tayo May 8, 2024
69efedb
remove possibly empty env var for k8s config
shadrach-tayo May 8, 2024
2c59b8b
Merge pull request #305 from desci-labs/email-log
shadrach-tayo May 8, 2024
a15ad72
capture failure
shadrach-tayo May 8, 2024
f4d9e23
Merge pull request #306 from desci-labs/capture-failure
shadrach-tayo May 8, 2024
456ffdf
feat: add html email to attestation claim mail
shadrach-tayo May 8, 2024
822d085
Merge pull request #307 from desci-labs/html-email
shadrach-tayo May 8, 2024
e706d79
quick fix
shadrach-tayo May 8, 2024
fc4b1d5
Merge pull request #308 from desci-labs/quick-email-fix
shadrach-tayo May 8, 2024
3f9121d
implement claim verification check api
shadrach-tayo May 9, 2024
4c3f62f
Merge pull request #309 from desci-labs/verify-check
shadrach-tayo May 9, 2024
c18eeee
remove orcid profile update on publish
shadrach-tayo May 9, 2024
f8ab688
Merge pull request #311 from desci-labs/orcid-writing
shadrach-tayo May 9, 2024
507f80e
orcid attestation writing structure and put code tracking db table sc…
shadrach-tayo May 10, 2024
80f775a
remove /root suffix from external-id urls
shadrach-tayo May 10, 2024
e272adb
fixed logic error for new/existing contributor invitation
kadamidev May 10, 2024
799cbcc
Merge pull request #313 from desci-labs/contrib-invite-email-fix
kadamidev May 10, 2024
702e954
Merge pull request #312 from desci-labs/orcid-structure
shadrach-tayo May 10, 2024
72cb519
fixed import via google for google proprietary docs (sheets/word)
kadamidev May 10, 2024
8184a38
non blocking after effects for mailing and orcid writing
shadrach-tayo May 10, 2024
8558dc0
Merge pull request #315 from desci-labs/orcid-refactor
shadrach-tayo May 10, 2024
a8d43f8
fix: api code paths build error
shadrach-tayo May 10, 2024
e09dbaa
Merge pull request #316 from desci-labs/orcid-refactor-update
shadrach-tayo May 10, 2024
8cabc5a
chore: document orcid api service class, methods and utils
shadrach-tayo May 13, 2024
14e6ea6
Merge pull request #318 from desci-labs/refactor/orcid-api
shadrach-tayo May 15, 2024
65e4954
insert orcid auth token on every fresh login attempt
shadrach-tayo May 15, 2024
a87c815
restore pg port
shadrach-tayo May 15, 2024
a535362
fix dpid script
hubsmoke May 16, 2024
1b6814c
add usage instruction to fix-dpid script
hubsmoke May 16, 2024
d482db1
hook up dpid fix to publish flow
hubsmoke May 16, 2024
67f7041
Merge pull request #321 from desci-labs/fix/orcid-auth-token
hubsmoke May 16, 2024
90b875f
move fixdpid to publish handler
hubsmoke May 16, 2024
52526cd
Merge branch 'develop' of https://github.com/desci-labs/nodes into de…
hubsmoke May 16, 2024
541657c
added src for contributor url for unauthed verifiable rendering, adde…
kadamidev May 16, 2024
5903363
Merge pull request #323 from desci-labs/contrib-inv-src
kadamidev May 16, 2024
b0b0cda
fix: unique external-ids for work record
shadrach-tayo May 17, 2024
12f79ae
Merge pull request #325 from desci-labs/orcid-external-id
shadrach-tayo May 17, 2024
e4e4efe
Merge pull request #317 from desci-labs/google-import-docs-fix
kadamidev May 20, 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
11 changes: 9 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ ORCID_CLIENT_SECRET=
REPO_SERVER_URL=http://host.docker.internal:5484
REPO_SERVICE_SECRET_KEY=secretrepo

# To run bootstrapCeramic.sh, clone `@desci-labs/desci-codex` and put the path here
CODEX_REPO_PATH=
# To run bootstrapCeramic.sh, you need the admin seed for the model IDs to be the same
CERAMIC_ADMIN_SEED=

# ISOLATED MEDIA SERVER
ISOLATED_MEDIA_SERVER_URL=http://media_isolated:7771
Expand All @@ -116,3 +116,10 @@ ETHEREUM_RPC_URL=http://host.docker.internal:8545

# Use this for Sepolia testnet
# ETHEREUM_RPC_URL=https://eth-sepolia.g.alchemy.com/v2/demo

DPID_URL_OVERRIDE=https://dev-beta.dpid.org

# Set to true if you want to mute the publish worker in local dev
MUTE_PUBLISH_WORKER=false
# SingleNodeLockServce
MAX_LOCK_TIME=3600 # 1 hour
112 changes: 112 additions & 0 deletions .github/workflows/build-reverse-proxy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# build.yml
on:
workflow_dispatch:
push:
paths:
- reverse-proxy/**
branches:
- develop
- main

# https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html
env:
AWS_DEFAULT_REGION: us-east-2
AWS_DEFAULT_OUTPUT: json
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 }}
CONTAINER_IMAGE: reverse-proxy
DOCKER_BUILDKIT: 1

jobs:
build-and-push:
name: Build and deploy
runs-on: ubuntu-latest
steps:
- uses: hashicorp/setup-terraform@v1
- name: Checkout
uses: actions/checkout@v4

# Add steps here like linting, testing, minification, etc.
- id: install-aws-cli
uses: unfor19/install-aws-cli-action@v1
with:
version: 1

- uses: prepor/action-aws-iam-authenticator@master
- run: aws-iam-authenticator version

- name: Install Kubectl
run: |
#$(curl -Ls https://dl.k8s.io/release/stable.txt)
version=v1.23.6
echo "using kubectl@$version"
curl -sLO "https://dl.k8s.io/release/$version/bin/linux/amd64/kubectl" -o kubectl
chmod +x kubectl
mv kubectl /usr/local/bin
mkdir $HOME/.kube
sudo apt-get update
sudo apt-get install less
echo ${{ secrets.KUBE_CONFIG_DATA }} | base64 --decode > $HOME/.kube/config
aws sts get-caller-identity
kubectl describe deployments

- name: Build and tag the image (DEV)
if: github.ref == 'refs/heads/develop'
run: |
# Build and tag the image
docker build \
-t $CONTAINER_IMAGE-dev:latest \
-t $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$CONTAINER_IMAGE-dev \
./$CONTAINER_IMAGE

- name: Build and tag the image (PROD)
if: github.ref == 'refs/heads/main'
run: |
# Build and tag the image
docker build \
-t $CONTAINER_IMAGE-prod:latest \
-t $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$CONTAINER_IMAGE-prod \
./$CONTAINER_IMAGE

- name: Push (DEV)
if: github.ref == 'refs/heads/develop'
run: |
# Push image to AWS ECR
aws ecr get-login-password --region $AWS_DEFAULT_REGION | docker login --username AWS --password-stdin $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com
docker tag $CONTAINER_IMAGE-dev:latest $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$CONTAINER_IMAGE-dev:${{ github.sha }}
docker tag $CONTAINER_IMAGE-dev:latest $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$CONTAINER_IMAGE-dev:latest
docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$CONTAINER_IMAGE-dev:${{ github.sha }}
docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$CONTAINER_IMAGE-dev:latest

- name: Push (PROD)
if: github.ref == 'refs/heads/main'
run: |
# Push image to AWS ECR
aws ecr get-login-password --region $AWS_DEFAULT_REGION | docker login --username AWS --password-stdin $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com
docker tag $CONTAINER_IMAGE-prod:latest $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$CONTAINER_IMAGE-prod:${{ github.sha }}
docker tag $CONTAINER_IMAGE-prod:latest $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$CONTAINER_IMAGE-prod:latest
docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$CONTAINER_IMAGE-prod:${{ github.sha }}
docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$CONTAINER_IMAGE-prod:latest

- name: Deploy to EKS (DEV)
if: github.ref == 'refs/heads/develop'
run: | # defaults to latest kubectl binary version
kubectl apply -f $CONTAINER_IMAGE/kubernetes/deployment_dev.yaml
kubectl set image deployment/reverse-proxy-dev reverse-proxy-dev=$AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$CONTAINER_IMAGE-dev:${{ github.sha }} --record

- name: Deploy to EKS (PROD)
if: github.ref == 'refs/heads/main'
run: | # defaults to latest kubectl binary version
kubectl apply -f $CONTAINER_IMAGE/kubernetes/deployment_prod.yaml
kubectl set image deployment/reverse-proxy-prod reverse-proxy-prod=$AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$CONTAINER_IMAGE-prod:${{ github.sha }} --record

- name: Verify EKS Deployment (DEV)
if: github.ref == 'refs/heads/develop'
run: |
kubectl rollout status deployment/reverse-proxy-dev

- name: Verify EKS Deployment (PROD)
if: github.ref == 'refs/heads/main'
run: |
kubectl rollout status deployment/reverse-proxy-prod
58 changes: 58 additions & 0 deletions .github/workflows/deploy-staging-services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -257,3 +257,61 @@ jobs:
- name: Verify EKS Deployment (STAGING)'
run: |
kubectl rollout status deployment/desci-server-staging

build-reverse-proxy:
name: Build and deploy reverse-proxy STAGING
runs-on: ubuntu-latest
steps:
- uses: hashicorp/setup-terraform@v1
- name: Checkout
uses: actions/checkout@v4

# Add steps here like linting, testing, minification, etc.
- id: install-aws-cli
uses: unfor19/install-aws-cli-action@v1
with:
version: 1

- uses: prepor/action-aws-iam-authenticator@master
- run: aws-iam-authenticator version

- name: Install Kubectl
run: |
#$(curl -Ls https://dl.k8s.io/release/stable.txt)
version=v1.23.6
echo "using kubectl@$version"
curl -sLO "https://dl.k8s.io/release/$version/bin/linux/amd64/kubectl" -o kubectl
chmod +x kubectl
mv kubectl /usr/local/bin
mkdir $HOME/.kube
sudo apt-get update
sudo apt-get install less
echo ${{ secrets.KUBE_CONFIG_DATA }} | base64 --decode > $HOME/.kube/config
aws sts get-caller-identity
kubectl describe deployments

- name: Build and tag the image (STAGING)
run: |
# Build and tag the image
docker build \
-t $CONTAINER_IMAGE-staging:latest \
-t $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$CONTAINER_IMAGE-staging \
./$CONTAINER_IMAGE

- name: Push (STAGING)
run: |
# Push image to AWS ECR
aws ecr get-login-password --region $AWS_DEFAULT_REGION | docker login --username AWS --password-stdin $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com
docker tag $CONTAINER_IMAGE-staging:latest $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$CONTAINER_IMAGE-staging:${{ github.sha }}
docker tag $CONTAINER_IMAGE-staging:latest $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$CONTAINER_IMAGE-staging:latest
docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$CONTAINER_IMAGE-staging:${{ github.sha }}
docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$CONTAINER_IMAGE-staging:latest

- name: Deploy to EKS (STAGING)
run: | # defaults to latest kubectl binary version
kubectl apply -f $CONTAINER_IMAGE/deployment.yaml
kubectl set image deployment/reverse-proxy-staging reverse-proxy-staging=$AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$CONTAINER_IMAGE-staging:${{ github.sha }} --record

- name: Verify EKS Deployment (STAGING)
run: |
kubectl rollout status deployment/reverse-proxy-staging
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ ipfs-data/
local-data/
node-modules/
node_modules/*
.idea
.idea
.composedbRuntimeDefinition.json
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.17.0
18.20.0
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18.17.0-bookworm
FROM node:18.20.0-bullseye

VOLUME /root/.yarn

Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,13 @@ This is a NodeJS backend that manages draft Nodes. It maintains a user auth, ver

## **nodes-lib**

A library for programmatically interacting with Nodes, basically allowing automation of actions possible in the webapp. See separate documentation in the [README](./nodes-lib/README.md)
A library for programmatically interacting with Nodes, basically allowing automation of actions possible in the webapp. See separate documentation in the [README](./nodes-lib/README.md).
<br><br>

## **reverse-proxy-service**

A tiny service for proxying route segments to given target URL's, allowing hiding many target destinations under aliases on one domain. See docs in [README](./reverse-proxy-service/README.md).

## **desci-art-viewer**

Nobody knows why this is still here, but it implements a React+Three.js 3d torus that plays [Conway's Game of Life](https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life) on the surface of the torus. We were totally inspired by [this gif on Wikipedia](https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life#/media/File:Trefoil_knot_conways_game_of_life.gif) and it only seems to work on Mac/Linux right now, YMMV.
Expand Down
67 changes: 41 additions & 26 deletions bootstrapCeramic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,17 @@
# There is no damage trying to run this multiple times in a row; it's
# idempotent.

set -euo pipefail

CTX="[bootstrapCeramic.sh]"
WAS_RUNNING=0

set -euo pipefail
trap catch ERR
catch() {
echo "$CTX script failed (are CODEX_REPO_PATH and TOGGLE_CERAMIC set in .env?)"
echo "$CTX script failed! Have you set CERAMIC_ADMIN_SEED in .env?"
if [ "$WAS_RUNNING" -eq "0" ]; then
docker compose --project-name desci down
fi
exit 1
}

Expand All @@ -25,38 +30,48 @@ if [[ ! -f .env ]]; then
exit 1
fi

# Assert desci-codex repo available
CODEX_REPO_PATH=$(grep "CODEX_REPO_PATH" .env | cut -d"=" -f2)
if [[ -z "$CODEX_REPO_PATH" ]]; then
echo "$CTX CODEX_REPO_PATH not set in .env, aborting!"
# Make sure we have the admin seed in env so modelIDs make sense
CERAMIC_ADMIN_SEED=$(grep "CERAMIC_ADMIN_SEED" .env | cut -d"=" -f2)
if [[ -z "$CERAMIC_ADMIN_SEED" ]]; then
echo "$CTX CERAMIC_ADMIN_SEED must be set in env, as the modelID's aren't deterministic otherwise."
exit 1
else
echo "$CTX Found codex repo path: $CODEX_REPO_PATH"
fi

# Assert ceramic service is running
# Check if ceramic service is already running
WAS_RUNNING=0
RUNNING_SERVICES=$(docker compose --project-name desci ps --services)
if ! grep -q ceramic <<<"$RUNNING_SERVICES"; then
echo "$CTX the ceramic compose service doesn't seem to be running, aborting!"
exit 1
echo "$CTX the ceramic compose service doesn't seem to be running, starting..."
docker compose \
-f docker-compose.dev.yml \
-f docker-compose.yml \
--project-name desci \
up ceramic \
--detach
sleep 5
else
echo "$CTX Ceramic service already running, won't touch compose services..."
WAS_RUNNING=1
fi

# Setup desci-codex and deploy composites
pushd "$CODEX_REPO_PATH"
echo "$CTX Downloading the runtime definition file for the composeDB models..."
curl -L --output .composedbRuntimeDefinition.json \
https://raw.githubusercontent.com/desci-labs/desci-codex/main/packages/composedb/src/__generated__/definition.json

# Check that the node admin secret is set up, otherwise the model ID's wont be correct
if [ ! -f "packages/composedb/admin_seed.txt" ]; then
echo "$CTX Composites need to be deployed with the ceramic node admin seed for the local node, as the model IDs aren't deterministic otherwise"
exit 1
fi
echo "$CTX Deploying composites to ceramic node..."
npx --yes @composedb/cli composite:deploy \
.composedbRuntimeDefinition.json \
--ceramic-url="http://localhost:7007" \
--did-private-key="$CERAMIC_ADMIN_SEED"

if [[ ! -d "node_modules" ]]; then
echo "$CTX installing deps desci-codex..."
npm ci
fi
sleep 5
echo "$CTX Deployment all good, probably!"

echo "$CTX deploying composites..."
npm run --workspace packages/composedb deployComposites
popd
if [ "$WAS_RUNNING" -eq "0" ]; then
echo "$CTX Shutting down ceramic service..."
docker compose --project-name desci down
else
echo "$CTX Leaving compose services up as they were already running when we started."
fi

echo "$CTX Done! Re-run this script if local state is cleaned."
echo "$CTX Done! You need to run me again if local data is wiped."
31 changes: 12 additions & 19 deletions ceramic-k8s/ceramic_deployment_dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,26 +48,19 @@ spec:
cpu: "0.6"
memory: 4Gi
# # restart pod after failureThreshold*periodSeconds total seconds
# livenessProbe:
# httpGet:
# path: /
# port: server-api
# failureThreshold: 80
# periodSeconds: 3
# # temporarily stop sending traffic to pod after failureThreshold*periodSeconds total seconds
# readinessProbe:
# httpGet:
# path: /
# port: server-api
# failureThreshold: 3
# periodSeconds: 1
livenessProbe:
httpGet:
path: /api/v0/node/healthcheck
port: http-api
failureThreshold: 10
periodSeconds: 5
# # wait for pod to start for failureThreshold*periodSeconds total seconds
# startupProbe:
# httpGet:
# path: /
# port: server-api
# failureThreshold: 200
# periodSeconds: 1
startupProbe:
httpGet:
path: /api/v0/node/healthcheck
port: http-api
failureThreshold: 60
periodSeconds: 1

serviceAccountName: "vault-auth"
---
Expand Down
Loading
Loading