rhoitjadhav commited on
Commit
142dd1a
1 Parent(s): 2c80eb3

update dockerfile

Browse files
Files changed (4) hide show
  1. .gitignore +1 -0
  2. Dockerfile +7 -2
  3. load_data.py +1 -1
  4. start.sh +9 -8
.gitignore ADDED
@@ -0,0 +1 @@
 
 
1
+ .idea
Dockerfile CHANGED
@@ -29,9 +29,14 @@ RUN chmod +x /start.sh \
29
 
30
  # Install Elasticsearch
31
  RUN curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add -
32
- RUN echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | tee -a /etc/apt/sources.list.d/elastic-7.x.list
33
  RUN apt update
34
- RUN apt -y install elasticsearch
 
 
 
 
 
35
 
36
  # Executing argilla along with elasticsearch
37
  CMD /bin/bash /start.sh
 
29
 
30
  # Install Elasticsearch
31
  RUN curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add -
32
+ RUN echo "deb https://artifacts.elastic.co/packages/8.x/apt stable main" | tee -a /etc/apt/sources.list.d/elastic-8.x.list
33
  RUN apt update
34
+ RUN apt -y install elasticsearch=8.5.3
35
+
36
+ # Disable security in elasticsearch configuration
37
+ RUN sudo sed -i "s/xpack.security.enabled: true/xpack.security.enabled: false/g" /etc/elasticsearch/elasticsearch.yml
38
+ RUN sudo sed -i "s/cluster.initial_master_nodes/#cluster.initial_master_nodes/g" /etc/elasticsearch/elasticsearch.yml
39
+ RUN sudo sed -i '$ a\cluster.routing.allocation.disk.threshold_enabled: false' /etc/elasticsearch/elasticsearch.yml
40
 
41
  # Executing argilla along with elasticsearch
42
  CMD /bin/bash /start.sh
load_data.py CHANGED
@@ -12,7 +12,7 @@ def load_datasets():
12
  # This is the code that you want to execute when the endpoint is available
13
  print("Argilla is available! Loading datasets")
14
  api_key = sys.argv[-1]
15
- rg.init(api_key=api_key, workspace="admin")
16
 
17
  # load dataset from json
18
  my_dataframe = pd.read_json(
 
12
  # This is the code that you want to execute when the endpoint is available
13
  print("Argilla is available! Loading datasets")
14
  api_key = sys.argv[-1]
15
+ rg.init(api_key=api_key, workspace="team")
16
 
17
  # load dataset from json
18
  my_dataframe = pd.read_json(
start.sh CHANGED
@@ -5,11 +5,6 @@ set -e
5
  # Changing user
6
  sudo -S su user
7
 
8
- # Disable security in elasticsearch configuration
9
- sudo sed -i "s/xpack.security.enabled: true/xpack.security.enabled: false/g" /etc/elasticsearch/elasticsearch.yml
10
- sudo sed -i "s/cluster.initial_master_nodes/#cluster.initial_master_nodes/g" /etc/elasticsearch/elasticsearch.yml
11
- echo "cluster.routing.allocation.disk.threshold_enabled: false" | sudo tee -a /etc/elasticsearch/elasticsearch.yml
12
-
13
  # Create elasticsearch directory and change ownerships
14
  sudo mkdir -p /var/run/elasticsearch
15
  sudo chown -R elasticsearch:elasticsearch /var/run/elasticsearch
@@ -20,10 +15,16 @@ sudo systemctl daemon-reload
20
  sudo systemctl enable elasticsearch.service
21
  sudo systemctl start elasticsearch.service
22
 
 
 
 
 
 
23
  # Update API_KEY and PASSWORD from users.yml
24
- sudo sed -i 's,API_KEY,'"$API_KEY"',g' /packages/users.yml
25
- sudo sed -i 's,ADMIN_PASSWORD,'"$ADMIN_PASSWORD"',g' /packages/users.yml
26
- sudo sed -i 's,ARGILLA_PASSWORD,'"$ARGILLA_PASSWORD"',g' /packages/users.yml
 
27
 
28
  # Load data
29
  pip3 install datasets
 
5
  # Changing user
6
  sudo -S su user
7
 
 
 
 
 
 
8
  # Create elasticsearch directory and change ownerships
9
  sudo mkdir -p /var/run/elasticsearch
10
  sudo chown -R elasticsearch:elasticsearch /var/run/elasticsearch
 
15
  sudo systemctl enable elasticsearch.service
16
  sudo systemctl start elasticsearch.service
17
 
18
+ # Generate hashed passwords
19
+ team_password=$(htpasswd -nbB "" "$TEAM_PASSWORD" | cut -d ":" -f 2 | tr -d "\n")
20
+ argilla_password=$(htpasswd -nbB "" "$ARGILLA_PASSWORD" | cut -d ":" -f 2 | tr -d "\n")
21
+
22
+
23
  # Update API_KEY and PASSWORD from users.yml
24
+ sudo sed -i 's,TEAM_API_KEY,'"$TEAM_API_KEY"',g' /packages/users.yml
25
+ sudo sed -i 's,ARGILLA_API_KEY,'"$ARGILLA_API_KEY"',g' /packages/users.yml
26
+ sudo sed -i 's,TEAM_PASSWORD,'"$team_password"',g' /packages/users.yml
27
+ sudo sed -i 's,ARGILLA_PASSWORD,'"$argilla_password"',g' /packages/users.yml
28
 
29
  # Load data
30
  pip3 install datasets