Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion creator-node/scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ if [[ "$devMode" == "true" ]]; then
if [ "$link_libs" = true ]
then
cd ../audius-libs
npm run dev &
npm link
cd ../app
npm link @audius/libs
Expand Down
1 change: 0 additions & 1 deletion identity-service/scripts/dev-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ link_libs=true
if [ "$link_libs" = true ]
then
cd ../audius-libs
npm run dev &
npm link
cd ../app
npm link @audius/libs
Expand Down
1 change: 1 addition & 0 deletions service-commands/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
output.log
error.log
libs.log
local-storage
2 changes: 2 additions & 0 deletions service-commands/scripts/run-libs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Convenience script to make it easier to grep for exactly what service command runs
npm run dev
39 changes: 24 additions & 15 deletions service-commands/scripts/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const {
identityServiceUp,
Service,
SetupCommand,
runSetupCommand,
runSetupCommand
} = ServiceCommands

const NUM_CREATOR_NODES = 4
Expand Down Expand Up @@ -61,7 +61,7 @@ program
false
)
.option(
'parallel',
'--parallel',
'Parallel provisioning - whether to provision CNs and DNs in parallel.',
false
)
Expand All @@ -75,11 +75,7 @@ program
'number of discovery nodes',
NUM_DISCOVERY_NODES.toString()
)
.option(
'-aao, --with-aao',
'whether to include AAO',
false
)
.option('-aao, --with-aao', 'whether to include AAO', false)
.option(
'-wspb, --with-solana-programs-build',
'whether to build solana programs (as opposed to using cached)',
Expand All @@ -92,11 +88,28 @@ program
)
.action(async opts => {
console.log('Bringing up services...')
console.log(`See ${process.env.PROTOCOL_DIR}/service-commands/output.log and ${process.env.PROTOCOL_DIR}/service-commands/error.log for troubleshooting.`)
console.log(
`See ${process.env.PROTOCOL_DIR}/service-commands/output.log and ${process.env.PROTOCOL_DIR}/service-commands/error.log for troubleshooting.`
)
const numCreatorNodes = parseInt(opts.numCnodes)
const numDiscoveryNodes = parseInt(opts.numDn)
const { verbose, parallel, withAao: withAAO, withSolanaProgramsBuild: buildSolana, withDataEthBuild: buildDataEthContracts } = opts
await allUp({ numCreatorNodes, numDiscoveryNodes, withAAO, verbose, parallel, buildSolana, buildDataEthContracts, opts })
const {
verbose,
parallel,
withAao: withAAO,
withSolanaProgramsBuild: buildSolana,
withDataEthBuild: buildDataEthContracts
} = opts
await allUp({
numCreatorNodes,
numDiscoveryNodes,
withAAO,
verbose,
parallel,
buildSolana,
buildDataEthContracts,
opts
})
})

program
Expand Down Expand Up @@ -164,11 +177,7 @@ program
'number of discovery nodes',
NUM_DISCOVERY_NODES.toString()
)
.option(
'-aao, --with-aao',
'whether to include AAO',
false
)
.option('-aao, --with-aao', 'whether to include AAO', false)
.action(async (service, command, opts) => {
try {
if (!service || !command) {
Expand Down
11 changes: 8 additions & 3 deletions service-commands/src/commands/service-commands.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"all": {
"down": [
"A run libs down",
"SERVICES=$(docker ps -aq); if [ \"$SERVICES\" != \"\" ]; then docker stop ${SERVICES} && docker rm ${SERVICES}; fi",
"docker container prune -f",
"docker volume prune -f",
Expand All @@ -18,9 +19,7 @@
},
"network": {
"up": [
"export DOCKER_CLIENT_TIMEOUT=360",
"export COMPOSE_HTTP_TIMEOUT=360",
"docker network create -d bridge audius_dev || true"
"export DOCKER_CLIENT_TIMEOUT=360; export COMPOSE_HTTP_TIMEOUT=360; docker network create -d bridge audius_dev || true"
],
"down": [
"docker network rm audius_dev || true"
Expand Down Expand Up @@ -342,5 +341,11 @@
"echo 'Stopping TN...'",
"cd $TN_DIR; . scripts/stop.sh dev"
]
},
"libs": {
"up": ["echo 'Process spawned in background using Node.'"],
"down": [
"ps x -o '%r %a' | grep '.*/audius-protocol/service-commands/scripts/run-libs.sh$' | awk '{print -$1}' | xargs -r kill -- -9"
]
}
}
Loading