Spaces:
Runtime error
Runtime error
Commit
·
d4d41c8
1
Parent(s):
cf13325
update dockerfile and users.yml
Browse files- Dockerfile +23 -30
- start.sh +0 -16
- users.yml +9 -0
Dockerfile
CHANGED
|
@@ -1,38 +1,31 @@
|
|
| 1 |
-
FROM
|
| 2 |
|
| 3 |
-
#
|
| 4 |
-
|
| 5 |
-
RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
|
| 6 |
-
RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
|
| 7 |
-
RUN yum install -y python39 python39-pip wget
|
| 8 |
-
|
| 9 |
-
# Copy setup files
|
| 10 |
-
COPY ./requirements.txt requirements.txt
|
| 11 |
-
COPY ./start.sh start.sh
|
| 12 |
-
RUN chown elasticsearch:elasticsearch requirements.txt
|
| 13 |
-
RUN chown elasticsearch:elasticsearch start.sh
|
| 14 |
-
|
| 15 |
-
# Change the user to the default user for the elasticsearch image
|
| 16 |
-
USER elasticsearch
|
| 17 |
|
| 18 |
-
#
|
| 19 |
-
|
| 20 |
-
|
| 21 |
|
| 22 |
-
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
-
# Install
|
| 26 |
-
RUN
|
| 27 |
|
| 28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
-
#
|
| 31 |
-
|
| 32 |
-
|
|
|
|
| 33 |
|
| 34 |
-
|
| 35 |
-
EXPOSE 6900
|
| 36 |
|
| 37 |
-
# Set the command to run the shell script
|
| 38 |
-
CMD ["./start.sh"]
|
|
|
|
| 1 |
+
FROM ubuntu:20.04
|
| 2 |
|
| 3 |
+
# Exposing ports
|
| 4 |
+
EXPOSE 6900
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
+
# Environment variables
|
| 7 |
+
ENV USERS_DB=/users.yml
|
| 8 |
+
ENV UVICORN_PORT=6900
|
| 9 |
|
| 10 |
+
# Install Python
|
| 11 |
+
RUN apt update
|
| 12 |
+
RUN apt -y install curl python3.9 python3.9-dev python3.9-distutils gcc gnupg
|
| 13 |
+
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
|
| 14 |
+
RUN python3.9 get-pip.py
|
| 15 |
|
| 16 |
+
# Install argilla
|
| 17 |
+
RUN pip install argilla[server]
|
| 18 |
|
| 19 |
+
# Install Elasticsearch
|
| 20 |
+
RUN curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add -
|
| 21 |
+
RUN echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | tee -a /etc/apt/sources.list.d/elastic-7.x.list
|
| 22 |
+
RUN apt update
|
| 23 |
+
RUN apt -y install elasticsearch
|
| 24 |
|
| 25 |
+
# Copy users db file along with execution script
|
| 26 |
+
COPY users.yml /
|
| 27 |
+
COPY start.sh /
|
| 28 |
+
RUN chmod +x /start.sh
|
| 29 |
|
| 30 |
+
CMD /bin/bash /start.sh
|
|
|
|
| 31 |
|
|
|
|
|
|
start.sh
DELETED
|
@@ -1,16 +0,0 @@
|
|
| 1 |
-
|
| 2 |
-
ES_JAVA_OPTS=-'Xms512m -Xmx512m' elasticsearch -E node.name=elasticsearch -E cluster.name=es-local -E discovery.type=single-node -E cluster.routing.allocation.disk.threshold_enabled=false &
|
| 3 |
-
./wait-for-it.sh -t 30 localhost:9200
|
| 4 |
-
if [ -z "$API_KEY" ] && [ -z "$PASSWORD" ]; then
|
| 5 |
-
python3 -m argilla
|
| 6 |
-
elif [ -z "$API_KEY" ] && [ -n "$PASSWORD" ]; then
|
| 7 |
-
export ARGILLA_LOCAL_AUTH_DEFAULT_PASSWORD=$PASSWORD
|
| 8 |
-
python3 -m argilla
|
| 9 |
-
elif [ -n "$API_KEY" ] && [ -z "$PASSWORD" ]; then
|
| 10 |
-
export ARGILLA_LOCAL_AUTH_DEFAULT_APIKEY=$API_KEY
|
| 11 |
-
python3 -m argilla
|
| 12 |
-
else
|
| 13 |
-
export ARGILLA_LOCAL_AUTH_DEFAULT_APIKEY=$API_KEY
|
| 14 |
-
export ARGILLA_LOCAL_AUTH_DEFAULT_PASSWORD=$PASSWORD
|
| 15 |
-
python3 -m argilla
|
| 16 |
-
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
users.yml
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
- username: argilla
|
| 2 |
+
hashed_password: $2b$12$vyJHxSgZ1MDeXvqOEVln.OjWiSY9x/wiAx8j9nP2VH0m9cOoyUq.a
|
| 3 |
+
api_key: "argilla.apikey"
|
| 4 |
+
workspaces: ["huggingface"]
|
| 5 |
+
- username: admin
|
| 6 |
+
hashed_password: $2b$12$vyJHxSgZ1MDeXvqOEVln.OjWiSY9x/wiAx8j9nP2VH0m9cOoyUq.a
|
| 7 |
+
api_key: "admin.apikey"
|
| 8 |
+
workspaces: []
|
| 9 |
+
|