-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1213 from facebookresearch/update-installation-in…
…structions Update Mephisto manual installation instructions
- Loading branch information
Showing
5 changed files
with
181 additions
and
71 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
.github/workflows/docker-testing-matrix-manual-install.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# This is a basic workflow to help you get started with Actions | ||
|
||
name: Docker Testing Matrix for manual installation script | ||
|
||
# Controls when the action will run. | ||
on: | ||
schedule: | ||
# Run once a week, in this case on Sundays | ||
- cron: "0 0 * * 0" | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
# This workflow contains a single job called "build" | ||
check: | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false # Run all combos, don't skip on failures | ||
matrix: | ||
# Here we will use different system images to test steps of installing Mephisto. | ||
# For now, it is just Ubuntu. | ||
system-version: ["ubuntu:22.04", "ubuntu:24.04"] | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v2 | ||
|
||
# Runs a single command using the runners shell | ||
- name: Build docker image - ${{ matrix.system-version }} | ||
run: docker build -f ./docker/dockerfiles/Dockerfile.ubuntu-24.04 -t mephisto_manual --build-arg BASE_IMAGE=${{ matrix.system-version }} . | ||
|
||
- name: Print out version numbers | ||
run: docker run mephisto_manual bash -c 'python --version && node --version && npm --version' | ||
|
||
# Runs a set of commands using the runners shell | ||
- name: Check that Mephisto was installed correctly | ||
run: | | ||
docker run mephisto_manual | ||
- name: Run command that removes and rebuilds all React apps related to the FormComposer | ||
run: | | ||
docker run mephisto_manual bash -c 'mephisto scripts form_composer rebuild_all_apps' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Latest LTS Ubuntu | ||
ARG BASE_IMAGE=ubuntu:24.04 | ||
FROM $BASE_IMAGE | ||
|
||
# [FOR DOCKERFILE ONLY] Skip interactive prompt questions, like selecting your geographic area | ||
ENV DEBIAN_FRONTEND noninteractive | ||
ENV DOCKER_CLI_HINTS false | ||
|
||
# 1. --- Setup environment --- | ||
|
||
# Install system requirements | ||
RUN apt update -y | ||
RUN apt upgrade -y | ||
RUN apt install software-properties-common keychain curl -y | ||
RUN add-apt-repository ppa:deadsnakes/ppa -y | ||
RUN apt update -y | ||
|
||
# Install Python env (Python3.9 and pip), and set default Python version | ||
RUN apt install wget python3.9 python3.9-dev python3.9-distutils -y | ||
RUN wget https://bootstrap.pypa.io/get-pip.py | ||
RUN python3.9 get-pip.py | ||
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.9 1 | ||
|
||
# Install JS env (Nodejs and Yarn) | ||
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash | ||
RUN export NVM_DIR="$HOME/.nvm" \ | ||
&& [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" \ | ||
&& [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" \ | ||
&& nvm install 16 \ | ||
&& ln -s $(which node) /usr/bin/node \ | ||
&& ln -s $(which npm) /usr/bin/npm | ||
|
||
RUN npm install -g yarn | ||
|
||
# 2. --- Setup Mephisto --- | ||
|
||
# Define path to the repo location | ||
ENV MEPHISTO_REPO_PATH /mephisto | ||
|
||
# [FOR DOCKERFILE ONLY] Copy repo into Docker container | ||
COPY . $MEPHISTO_REPO_PATH | ||
|
||
# Upgrade pip so we can use the `pyproject.toml` without raising an error | ||
RUN pip install --upgrade pip | ||
# Install Python requirements | ||
# [FOR DOCKERFILE ONLY] `--ignore-installed` - some libs can be preinstall in Docker-system | ||
# Use `cd /mephisto && pip install -e .` in your local environment | ||
RUN cd /mephisto && pip install --ignore-installed -e . | ||
|
||
# Setup Mephisto's directories | ||
RUN mkdir -p ~/.mephisto | ||
# Create Mephisto's data directory | ||
RUN mkdir -p $MEPHISTO_REPO_PATH/data | ||
# Change Mephisto data directory from the default `data/` in repo root to `~/mephisto-data/data/` | ||
RUN mephisto config core.main_data_directory $MEPHISTO_REPO_PATH/data | ||
|
||
# Assert that everything has been set up correctly | ||
RUN mephisto check | ||
|
||
CMD mephisto check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters