Spaces:
Runtime error
Runtime error
Commit
·
cf13325
0
Parent(s):
Duplicate from argilla/template-space-docker
Browse filesCo-authored-by: Daniel Vila <[email protected]>
- .gitattributes +34 -0
- .gitignore +1 -0
- Dockerfile +38 -0
- README.md +18 -0
- requirements.txt +2 -0
- start.sh +16 -0
.gitattributes
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
28 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
29 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
30 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
31 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
32 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
33 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
34 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
.gitignore
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
.history
|
Dockerfile
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2
|
2 |
+
|
3 |
+
# Install Python
|
4 |
+
RUN cd /etc/yum.repos.d/
|
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 |
+
# API KEY and password
|
19 |
+
RUN --mount=type=secret,id=API_KEY,mode=0444,required=false
|
20 |
+
ARG API_KEY=$(cat /run/secrets/API_KEY)
|
21 |
+
|
22 |
+
RUN --mount=type=secret,id=PASSWORD,mode=0444,required=false
|
23 |
+
ARG PASSWORD=$(cat /run/secrets/PASSWORD)
|
24 |
+
|
25 |
+
# Install Python deps
|
26 |
+
RUN pip3 install -U -r requirements.txt
|
27 |
+
|
28 |
+
RUN wget https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh
|
29 |
+
|
30 |
+
# Make scripts executable
|
31 |
+
RUN chmod +x wait-for-it.sh
|
32 |
+
RUN chmod +x start.sh
|
33 |
+
|
34 |
+
# Expose the application's port
|
35 |
+
EXPOSE 6900
|
36 |
+
|
37 |
+
# Set the command to run the shell script
|
38 |
+
CMD ["./start.sh"]
|
README.md
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
title: Template Argilla Space Docker
|
3 |
+
emoji: 📊
|
4 |
+
colorFrom: gray
|
5 |
+
colorTo: yellow
|
6 |
+
sdk: docker
|
7 |
+
pinned: false
|
8 |
+
app_port: 6900
|
9 |
+
fullWidth: true
|
10 |
+
duplicated_from: argilla/template-space-docker
|
11 |
+
---
|
12 |
+
|
13 |
+
Use this Space to launch your Argilla app. This space can be configured with two secret env variables (you can find how to this under Settings in your Space page):
|
14 |
+
|
15 |
+
- `API_KEY`: You can set up your own API key for uploading and reading data with Argilla Python client. This API_KEY can be any string you want.
|
16 |
+
- `PASSWORD`: You can set up the password for login into the UI, in case you want to disable access to other users. The default username is `argilla`. If you don't set up this secret the password will be `1234`
|
17 |
+
|
18 |
+
|
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
argilla[server]
|
2 |
+
fastapi
|
start.sh
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|