Skip to content

Commit

Permalink
Add sync EFS to S3
Browse files Browse the repository at this point in the history
  • Loading branch information
jayhuynh committed Dec 23, 2023
1 parent dcada01 commit 260e783
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 9 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ COPY . /mephisto
RUN mkdir ~/.mephisto

# Create the main Mephisto data directory
RUN mkdir -p /mephisto/data
RUN mkdir -p /mephisto/data/results

SHELL ["/bin/bash", "-c"]
# Write the mephisto config file manually for now to avoid prompt.
# For bash-style string $ expansion for newlines,
# we need to switch the shell to bash:
RUN echo $'core: \n main_data_directory: /mephisto/data' >> ~/.mephisto/config.yml
RUN echo $'core: \n main_data_directory: /mephisto/data/results' >> ~/.mephisto/config.yml

WORKDIR /mephisto
RUN pip3 install -e .
Expand All @@ -47,4 +47,4 @@ RUN yarn install
RUN yarn build-all
RUN mephisto metrics install

CMD bash -c "sleep infinity"
CMD bash -c "sleep infinity"
2 changes: 1 addition & 1 deletion Dockerfile-frontend
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ RUN yarn build-all
# For bash-style string $ expansion for newlines,
# we need to switch the shell to bash:
SHELL ["/bin/bash", "-c"]
RUN echo $'core: \n main_data_directory: /mephisto/data' >> ~/.mephisto/config.yml
RUN echo $'core: \n main_data_directory: /mephisto/data/results' >> ~/.mephisto/config.yml

# Uncomment if you'd like to install the Mephisto CLI as well:
# RUN cd /mephisto && ls && pip install -e .
Expand Down
2 changes: 1 addition & 1 deletion app/clean_up.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
mephisto_data_root="/mephisto/data"
mephisto_data_root="/mephisto/data/results"

mephisto_script_root="/mephisto/scripts"

Expand Down
4 changes: 2 additions & 2 deletions app/hydra_configs/conf/prod_prolific.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ mephisto:
provider:
prolific_external_study_url: "https://example.com?participant_id={{%PROLIFIC_PID%}}&study_id={{%STUDY_ID%}}&submission_id={{%SESSION_ID%}}"
prolific_id_option: "url_parameters"
prolific_workspace_name: "Jay Test"
prolific_project_name: "test"
prolific_workspace_name: "UQ Workspace"
prolific_project_name: "Big5_LLM"
prolific_estimated_completion_time_in_minutes: 1
# prolific_allow_list_group_name: "Allow list"
# prolific_block_list_group_name: "Block list"
Expand Down
43 changes: 43 additions & 0 deletions app/hydra_configs/conf/test_prolific.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#@package _global_
defaults:
- /mephisto/blueprint: static_react_task
- /mephisto/architect: ec2
- /mephisto/provider: prolific
mephisto:
architect:
_architect_type: ec2
profile_name: mpt
subdomain: "mpt-t.1"
blueprint:
data_json: ${task_dir}/data.json
task_source: ${task_dir}/webapp/build/bundle.js
link_task_source: false
extra_source_dir: ${task_dir}/webapp/src/static
units_per_assignment: 1
log_level: "debug"
task:
task_name: "mpt-t"
task_title: "mpt-t Task"
task_description: "This is a simple test of static Prolific tasks."
task_reward: 10
task_tags: "static,task,testing"
max_num_concurrent_units: 1
provider:
prolific_external_study_url: "https://example.com?participant_id={{%PROLIFIC_PID%}}&study_id={{%STUDY_ID%}}&submission_id={{%SESSION_ID%}}"
prolific_id_option: "url_parameters"
prolific_workspace_name: "Jay Test"
prolific_project_name: "test"
prolific_estimated_completion_time_in_minutes: 1
# prolific_allow_list_group_name: "Allow list"
# prolific_block_list_group_name: "Block list"
# prolific_eligibility_requirements:
# - name: "CustomWhitelistEligibilityRequirement"
# white_list:
# - 6463d32f50a18041930b71be
# - 6463d3922d7d99360896228f
# - 6463d40e8d5d2f0cce2b3b23
# - 6463d44ed1b61a8fb4e0765a
# - 6463d488c2f2821eaa2fa13f
# - name: "ApprovalRateEligibilityRequirement"
# minimum_approval_rate: 0
# maximum_approval_rate: 100
4 changes: 2 additions & 2 deletions app/sync_s3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
APP_NAME=${1:-temp-app}
S3_BUCKET_NAME=${2:-s3://mephisto-data}

mephisto_data_root="/mephisto/data"
mephisto_data_root="/mephisto/data/results"

echo "[$(date)] Syncing $mephisto_data_root to $S3_BUCKET_NAME/data-v2/$APP_NAME!"
aws s3 sync $mephisto_data_root $S3_BUCKET_NAME/data-v2/$APP_NAME --profile mpt
aws s3 sync $mephisto_data_root $S3_BUCKET_NAME/data-v2/$APP_NAME

echo "[$(date)] Sync complete!"

0 comments on commit 260e783

Please sign in to comment.