Skip to content

Commit

Permalink
wrapperless audius-ctl (#10448)
Browse files Browse the repository at this point in the history
Co-authored-by: endline <endline>
  • Loading branch information
endline authored Dec 5, 2024
1 parent 4d62614 commit 32583b9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
4 changes: 3 additions & 1 deletion cmd/audiusd/entrypoint.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,15 @@ export uptimeDataDir=${uptimeDataDir:-/data/bolt}
export audius_core_root_dir=${audius_core_root_dir:-/data/audiusd}
export creatorNodeEndpoint=${creatorNodeEndpoint:-http://localhost}

if [ ! -d "$POSTGRES_DATA_DIR" ] || [ -z "$(ls -A "$POSTGRES_DATA_DIR")" ]; then
if [ ! -d "$POSTGRES_DATA_DIR" ] || [ -z "$(ls -A "$POSTGRES_DATA_DIR" 2>/dev/null)" ]; then
echo "Initializing PostgreSQL data directory at $POSTGRES_DATA_DIR..."
su - postgres -c "/usr/lib/postgresql/*/bin/initdb -D $POSTGRES_DATA_DIR"

echo "Updating PostgreSQL configuration for password authentication..."
sed -i "s/peer/trust/g" "$POSTGRES_DATA_DIR/pg_hba.conf"
sed -i "s/md5/trust/g" "$POSTGRES_DATA_DIR/pg_hba.conf"
else
echo "PostgreSQL data directory already initialized at $POSTGRES_DATA_DIR."
fi

chown -R postgres:postgres "$POSTGRES_DATA_DIR"
Expand Down
26 changes: 16 additions & 10 deletions pkg/orchestration/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,36 +414,42 @@ func runNodeWrapperless(
}
hostConfig := &container.HostConfig{
Mounts: []mount.Mount{
mount.Mount{
{
Type: mount.TypeBind,
Source: "/var/k8s/mediorum",
Target: "/tmp/mediorum",
},
mount.Mount{
{
Type: mount.TypeBind,
Source: "/var/k8s/creator-node-backend",
Target: "/file_storage",
},
mount.Mount{
{
Type: mount.TypeBind,
Source: "/var/k8s/creator-node-db-15",
Target: "/var/lib/postgresql/data",
},
mount.Mount{
{
Type: mount.TypeBind,
Source: "/var/k8s/bolt",
Target: "/bolt",
},
mount.Mount{
{
Type: mount.TypeBind,
Source: "/var/k8s/bolt",
Target: "/audius-core",
},
mount.Mount{
{
Type: mount.TypeBind,
Source: "/var/k8s/env",
Target: "/env",
},
// allow me to work on entrypoint without building the image
{
Type: mount.TypeBind,
Source: "/private/var/orion/audius/audius-protocol/cmd/audiusd/entrypoint.sh",
Target: "/bin/entrypoint.sh",
},
},
}

Expand Down Expand Up @@ -567,10 +573,10 @@ func runNodeWrapperless(
}
}

logger.Info("Creating auto-update cron job")
if err := setAutoUpdateCron(host, config.Version, nconf.DeployOn); err != nil {
return logger.Error("Failed to add auto-update cron job:", err)
}
// logger.Info("Creating auto-update cron job")
// if err := setAutoUpdateCron(host, config.Version, nconf.DeployOn); err != nil {
// return logger.Error("Failed to add auto-update cron job:", err)
// }

return nil
}
Expand Down

0 comments on commit 32583b9

Please sign in to comment.