Skip to content

Commit

Permalink
Merge branch 'main' into as/proto-1574
Browse files Browse the repository at this point in the history
  • Loading branch information
alecsavvy committed Feb 27, 2024
2 parents ca72fa5 + 40583e6 commit c975c2d
Show file tree
Hide file tree
Showing 77 changed files with 745 additions and 437 deletions.
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ jobs:
- ./packages/ddex/webapp/node_modules
- ./packages/ddex/publisher/node_modules
- ./packages/trpc-server/node_modules
- ./packages/dotenv-linter/bin

generate-release-branch:
working_directory: ~/audius-protocol
Expand Down
1 change: 0 additions & 1 deletion .circleci/src/jobs/release-audius-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,4 @@ steps:
- run:
name: Release
command: |
export PROTOCOL_DIR=$PWD
packages/libs/scripts/release.sh << parameters.sdk-release-commit >> << parameters.sdk-release-version >> << parameters.sdk-release-preid >>
2 changes: 0 additions & 2 deletions dev-tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,12 @@ audius-compose connect

Use these CLI tools for Audius dev. Currently there are 3 tools available:

- `audius-cloud`: create a pre-configured GCP VM for dev
- `audius-compose`: start, stop, and manage Audius service containers
- `audius-cmd`: perform user actions, e.g. `create-user`, `upload-track`, `repost-playlist`

View all available commands for any of these tools with `--help`, e.g.

```bash
> audius-cloud --help
> audius-compose --help
> audius-cmd --help
```
Expand Down
172 changes: 0 additions & 172 deletions dev-tools/audius-cloud

This file was deleted.

6 changes: 2 additions & 4 deletions dev-tools/audius-cmd
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#!/usr/bin/env bash
set -e

if [[ "$PROTOCOL_DIR" != "" ]]; then
cd $PROTOCOL_DIR/dev-tools/compose
fi
export COMPOSE_PROJECT_NAME=$(basename $PROTOCOL_DIR)
cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/compose # audius-protocol/dev-tools/compose
export COMPOSE_PROJECT_NAME='audius-protocol'

if [[ "$1" == "test" ]]; then
docker compose exec audius-cmd npm test
Expand Down
4 changes: 1 addition & 3 deletions dev-tools/audius-compose
Original file line number Diff line number Diff line change
Expand Up @@ -170,23 +170,21 @@ def generate_env(
@click.group()
@click.option(
"--protocol-dir",
envvar="PROTOCOL_DIR",
type=click.Path(
exists=True, file_okay=False, resolve_path=True, path_type=pathlib.Path
),
)
@click.pass_context
def cli(ctx, protocol_dir):
if protocol_dir is None:
protocol_dir = pathlib.Path.cwd().resolve()
protocol_dir = pathlib.Path(os.path.dirname(os.path.realpath(__file__))).resolve()
while (
protocol_dir.name != ""
and not (protocol_dir / "dev-tools/compose/docker-compose.yml").exists()
):
protocol_dir = protocol_dir.parent
if protocol_dir.name == "":
raise click.ClickException("Unable to find protocol dir")
click.confirm(f'Using protocol dir "{protocol_dir}"', default=True, abort=True)

ctx.obj = protocol_dir

Expand Down
12 changes: 0 additions & 12 deletions dev-tools/setup-dev.sh

This file was deleted.

23 changes: 10 additions & 13 deletions dev-tools/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ debian | ubuntu)

# Increase file watchers
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

# add script directories to path, avoiding duplication
grep -q "export PATH=$HOME/.local/bin:" ~/.profile || echo "export PATH=$HOME/.local/bin:\$PATH" >>~/.profile

;;
*)
if ! command -v docker &>/dev/null; then
Expand All @@ -72,22 +76,15 @@ debian | ubuntu)
esac

if [[ "${BASH_SOURCE[0]}" == "" ]]; then
export PROTOCOL_DIR="${PROTOCOL_DIR:-$HOME/audius-protocol}"
git clone https://github.com/AudiusProject/audius-protocol.git "$PROTOCOL_DIR"
protocol_dir="$HOME/audius-protocol"
git clone https://github.com/AudiusProject/audius-protocol.git "$protocol_dir"
else
export PROTOCOL_DIR="$(dirname "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")"
protocol_dir="$(dirname "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")"
fi

python3 -m pip install -r "$PROTOCOL_DIR/dev-tools/requirements.txt"
python3 -m pip install -r "$protocol_dir/dev-tools/requirements.txt"

mkdir -p "$HOME/.local/bin"

ln -sf "$PROTOCOL_DIR/dev-tools/audius-compose" "$HOME/.local/bin/audius-compose"
ln -sf "$PROTOCOL_DIR/dev-tools/audius-cloud" "$HOME/.local/bin/audius-cloud"
ln -sf "$PROTOCOL_DIR/dev-tools/audius-cmd" "$HOME/.local/bin/audius-cmd"

# Add env vars to .profile, avoiding duplication
grep -q PROTOCOL_DIR ~/.profile || echo "export PROTOCOL_DIR=$PROTOCOL_DIR" >>~/.profile
grep -q "export PATH=$HOME/.local/bin:" ~/.profile || echo "export PATH=$HOME/.local/bin:\$PATH" >>~/.profile

[[ "$AUDIUS_DEV" != "false" ]] && . "$PROTOCOL_DIR/dev-tools/setup-dev.sh" || true
ln -sf "$protocol_dir/dev-tools/audius-compose" "$HOME/.local/bin/audius-compose"
ln -sf "$protocol_dir/dev-tools/audius-cmd" "$HOME/.local/bin/audius-cmd"
24 changes: 24 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c975c2d

Please sign in to comment.