Skip to content

Commit 43239ec

Browse files
authored
[Bugfix] argilla server: allow define workspace for argilla server 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/)
1 parent 0df40d2 commit 43239ec

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

argilla-server/docker/server/scripts/start_argilla_server.sh

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,19 @@ python -m argilla_server database migrate
66

77
if [ -n "$USERNAME" ] && [ -n "$PASSWORD" ]; then
88
echo "Creating owner user with username ${USERNAME}"
9+
10+
cmd_args="--first-name $USERNAME --username $USERNAME --password $PASSWORD --role owner"
11+
912
if [ -n "$API_KEY" ]; then
10-
python -m argilla_server database users create \
11-
--first-name "$USERNAME" \
12-
--username "$USERNAME" \
13-
--password "$PASSWORD" \
14-
--api-key "$API_KEY" \
15-
--role owner
16-
else
17-
python -m argilla_server database users create \
18-
--first-name "$USERNAME" \
19-
--username "$USERNAME" \
20-
--password "$PASSWORD" \
21-
--role owner
13+
cmd_args="$cmd_args --api-key $API_KEY"
14+
fi
15+
16+
if [ -n "$WORKSPACE" ]; then
17+
cmd_args="$cmd_args --workspace $WORKSPACE"
2218
fi
19+
20+
python -m argilla_server database users create $cmd_args
21+
2322
else
2423
echo "No username and password was provided. Skipping user creation"
2524
fi

argilla/docs/reference/argilla-server/configuration.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ Redis is used by Argilla to store information about jobs to be processed on back
104104

105105
- `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: `""`).
106106

107+
- `WORKSPACE`: If provided, the workspace name. If `USERNAME`, `PASSWORD` and `WORSPACE` are provided, a default workspace will be created with this name (Default: `""`).
108+
107109
- `API_KEY`: The default user api key to user. If API_KEY is not provided, a new random api key will be generated (Default: `""`).
108110

109111
- `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`.

examples/deployments/docker/docker-compose.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ services:
1515
USERNAME: argilla
1616
PASSWORD: 12345678
1717
API_KEY: argilla.apikey
18+
WORKSPACE: default
1819
# Uncomment the following line to reindex Argilla datasets into the search engine when starting up
1920
# REINDEX_DATASETS: 1
2021
# Opt-out for telemetry https://huggingface.co/docs/huggingface_hub/main/en/package_reference/utilities#huggingface_hub.utils.send_telemetry

0 commit comments

Comments
 (0)