Skip to content

Commit

Permalink
[INF-76] New Local Deployment Setup with docker-compose (#2988)
Browse files Browse the repository at this point in the history
Co-authored-by: Raymond Jacobson <ray@audius.co>
  • Loading branch information
cheran-senthil and raymondjacobson authored Jul 14, 2022
1 parent a3bc512 commit ba91046
Show file tree
Hide file tree
Showing 55 changed files with 80,542 additions and 38,287 deletions.
17 changes: 9 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -377,19 +377,20 @@ jobs:
POSTGRES_DB: audius_discovery
- image: docker.elastic.co/elasticsearch/elasticsearch:8.1.0
environment:
- network.host=0.0.0.0
- discovery.type=single-node
- cluster.name=docker-cluster
- node.name=cluster1-node1
- xpack.security.enabled=false
- 'ES_JAVA_OPTS=-Xms512m -Xmx512m'
network.host: '0.0.0.0'
discovery.type: 'single-node'
cluster.name: 'docker-cluster'
node.name: 'cluster1-node1'
xpack.security.enabled: 'false'
ES_JAVA_OPTS: '-Xms512m -Xmx512m'
- image: ipfs/go-ipfs:release
# Bring up ganache
- image: redis:3.0-alpine
- image: trufflesuite/ganache-cli:latest
command: ['--port=8555', '-a', '100', '-l', '8000000']
- image: trufflesuite/ganache-cli:latest
command: ['--port=8556', '-a', '100', '-l', '8000000']
resource_class: medium+
steps:
- checkout
- diff-if-necessary:
Expand Down Expand Up @@ -663,7 +664,7 @@ jobs:
type: string
logspout-tag:
type: string
default: ""
default: ''
steps:
- checkout
- setup_remote_docker:
Expand Down Expand Up @@ -794,7 +795,7 @@ workflows:
- docker-build-and-push:
name: build-logspout
repo: logspout
logspout-tag: "true"
logspout-tag: 'true'
requires:
- hold-build-logspout
- hold-bake-gcp-dev-image:
Expand Down
21 changes: 21 additions & 0 deletions contracts/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM node:16 as builder
COPY package*.json ./
RUN npm install --loglevel verbose

FROM node:16-slim

WORKDIR /usr/src/app

COPY --from=builder /node_modules ./node_modules
COPY . .

ARG bootstrapSPIds
ARG bootstrapSPDelegateWallets
ARG bootstrapSPOwnerWallets

RUN ./scripts/setup-predeployed-ganache.sh /usr/db

HEALTHCHECK --interval=5s --timeout=5s --retries=10 \
CMD node -e "require('http').request('http://localhost:8545').end()" || exit 1

CMD ["npx", "ganache", "--server.host", "0.0.0.0", "--database.dbPath", "/usr/db", "--wallet.deterministic", "--wallet.totalAccounts", "50"]
10 changes: 9 additions & 1 deletion contracts/contract-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ module.exports = {
userReplicaSetBootstrapAddress: null,
registryAddress: '0xCfEB869F69431e42cdB54A4F4f105C19C080A601'
},
predeploy: {
verifierAddress: '0xbbbb93A6B3A1D6fDd27909729b95CCB0cc9002C0',
blacklisterAddress: null,
bootstrapSPIds: process.env.bootstrapSPIds ? process.env.bootstrapSPIds.split(",") : [],
bootstrapSPDelegateWallets: process.env.bootstrapSPDelegateWallets ? process.env.bootstrapSPDelegateWallets.split(",") : [],
bootstrapSPOwnerWallets: process.env.bootstrapSPOwnerWallets ? process.env.bootstrapSPOwnerWallets.split(",") : [],
userReplicaSetBootstrapAddress: null
},
test_local: {
verifierAddress: null,
blacklisterAddress: null,
Expand Down Expand Up @@ -101,4 +109,4 @@ module.exports = {
userReplicaSetBootstrapAddress: '0x3d2563ACCD9E6D189bA2a61F116905D520054286',
registryAddress: '0x793373aBF96583d5eb71a15d86fFE732CD04D452'
}
}
}
4 changes: 2 additions & 2 deletions contracts/migrations/4_user_replica_set_migration.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = (deployer, network, accounts) => {
const config = contractConfig[network]
let registry
let registryAddress
if (network === 'test_local' || network === 'development') {
if (network === 'test_local' || network === 'development' || network === 'predeploy') {
registryAddress = process.env.dataContractsRegistryAddress
registry = await Registry.at(registryAddress)
} else {
Expand All @@ -43,7 +43,7 @@ module.exports = (deployer, network, accounts) => {
const bootstrapSPOwnerWallets = config.bootstrapSPOwnerWallets
const invalidBootstrapConfiguration = (bootstrapSPIds.length === 0 || bootstrapNodeDelegateWallets.length === 0 || bootstrapSPOwnerWallets.length === 0)
if (
(network !== 'test_local' && network !== 'development') &&
(network !== 'test_local' && network !== 'development' && network !== 'predeploy') &&
(invalidBootstrapConfiguration)
) {
throw new Error(
Expand Down
Loading

0 comments on commit ba91046

Please sign in to comment.