Skip to content

Commit

Permalink
[Bugfix] argilla server: allow define workspace for argilla server …
Browse files Browse the repository at this point in the history
…image (#5517)

# Description
<!-- Please include a summary of the changes and the related issue.
Please also include relevant motivation and context. List any
dependencies that are required for this change. -->

Closes #5505

**Type of change**
<!-- Please delete options that are not relevant. Remember to title the
PR according to the type of change -->

- Bug fix (non-breaking change which fixes an issue)
- Documentation update

**How Has This Been Tested**
<!-- Please add some reference about how your feature has been tested.
-->

**Checklist**
<!-- Please go over the list and make sure you've taken everything into
account -->

- I added relevant documentation
- I followed the style guidelines of this project
- I did a self-review of my code
- I made corresponding changes to the documentation
- I confirm My changes generate no new warnings
- I have added tests that prove my fix is effective or that my feature
works
- I have added relevant notes to the CHANGELOG.md file (See
https://keepachangelog.com/)
  • Loading branch information
frascuchon authored Sep 23, 2024
1 parent 0df40d2 commit 43239ec
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
23 changes: 11 additions & 12 deletions argilla-server/docker/server/scripts/start_argilla_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,19 @@ python -m argilla_server database migrate

if [ -n "$USERNAME" ] && [ -n "$PASSWORD" ]; then
echo "Creating owner user with username ${USERNAME}"

cmd_args="--first-name $USERNAME --username $USERNAME --password $PASSWORD --role owner"

if [ -n "$API_KEY" ]; then
python -m argilla_server database users create \
--first-name "$USERNAME" \
--username "$USERNAME" \
--password "$PASSWORD" \
--api-key "$API_KEY" \
--role owner
else
python -m argilla_server database users create \
--first-name "$USERNAME" \
--username "$USERNAME" \
--password "$PASSWORD" \
--role owner
cmd_args="$cmd_args --api-key $API_KEY"
fi

if [ -n "$WORKSPACE" ]; then
cmd_args="$cmd_args --workspace $WORKSPACE"
fi

python -m argilla_server database users create $cmd_args

else
echo "No username and password was provided. Skipping user creation"
fi
Expand Down
2 changes: 2 additions & 0 deletions argilla/docs/reference/argilla-server/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ Redis is used by Argilla to store information about jobs to be processed on back

- `PASSWORD`: If provided, the owner password. If `USERNAME` and `PASSWORD` are provided, the owner user will be created with these credentials on the server startup (Default: `""`).

- `WORKSPACE`: If provided, the workspace name. If `USERNAME`, `PASSWORD` and `WORSPACE` are provided, a default workspace will be created with this name (Default: `""`).

- `API_KEY`: The default user api key to user. If API_KEY is not provided, a new random api key will be generated (Default: `""`).

- `UVICORN_APP`: [Advanced] The name of the FastAPI app to run. This is useful when you want to extend the FastAPI app with additional routes or middleware. The default value is `argilla_server:app`.
Expand Down
1 change: 1 addition & 0 deletions examples/deployments/docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ services:
USERNAME: argilla
PASSWORD: 12345678
API_KEY: argilla.apikey
WORKSPACE: default
# Uncomment the following line to reindex Argilla datasets into the search engine when starting up
# REINDEX_DATASETS: 1
# Opt-out for telemetry https://huggingface.co/docs/huggingface_hub/main/en/package_reference/utilities#huggingface_hub.utils.send_telemetry
Expand Down

0 comments on commit 43239ec

Please sign in to comment.