Skip to content

Commit

Permalink
Merge branch 'develop' into docs/onboarding_improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
frascuchon authored Jul 29, 2024
2 parents 7c5f5e0 + 0c860ec commit 734dea4
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 36 deletions.
5 changes: 1 addition & 4 deletions argilla-server/docker/argilla-hf-spaces/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ USER root

# Copy Argilla distribution files
COPY scripts/start.sh /home/argilla
COPY scripts/start_argilla_server.sh /home/argilla
COPY Procfile /home/argilla
COPY requirements.txt /packages/requirements.txt

Expand Down Expand Up @@ -52,9 +51,7 @@ USER argilla
ENV ELASTIC_CONTAINER=true
ENV ES_JAVA_OPTS="-Xms1g -Xmx1g"

ENV USERNAME=""
ENV PASSWORD=""

ENV ARGILLA_HOME_PATH=/data/argilla
ENV REINDEX_DATASETS=1

CMD ["/bin/bash", "start.sh"]

This file was deleted.

9 changes: 5 additions & 4 deletions argilla-server/docker/server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ RUN apt-get update && \
FROM python:3.10.12-slim

# Environment Variables
ENV USERNAME=""
ENV PASSWORD=""
ENV API_KEY=""
## Argilla home path
ENV ARGILLA_HOME_PATH=/var/lib/argilla
ENV DEFAULT_USER_ENABLED=true
ENV DEFAULT_USER_PASSWORD=1234
ENV DEFAULT_USER_API_KEY=argilla.apikey
ENV USERS_DB=/config/.users.yml
## Uvicorn defaults
ENV UVICORN_PORT=6900

RUN useradd -ms /bin/bash argilla
Expand Down
21 changes: 18 additions & 3 deletions argilla-server/docker/server/scripts/start_argilla_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,24 @@ set -e
# Run database migrations
python -m argilla_server database migrate

# Create default user
if [ "$DEFAULT_USER_ENABLED" = "true" ] || [ "$DEFAULT_USER_ENABLED" = "1" ]; then
python -m argilla_server database users create_default --password $DEFAULT_USER_PASSWORD --api-key $DEFAULT_USER_API_KEY
if [ -n "$USERNAME" ] && [ -n "$PASSWORD" ]; then
echo "Creating owner user with username ${USERNAME}"
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
fi
else
echo "No username and password was provided. Skipping user creation"
fi

# Reindexing data into search engine
Expand Down

0 comments on commit 734dea4

Please sign in to comment.