-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
df4ded5
commit 31cbdd9
Showing
4 changed files
with
122 additions
and
0 deletions.
There are no files selected for viewing
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,2 @@ | ||
data/* | ||
Dockerfile |
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,43 @@ | ||
|
||
## Docker Setup | ||
|
||
We also provide a Dockerfile to run MorphQ in a Docker container. | ||
|
||
1. To build the Docker image, run the following command: | ||
```bash | ||
docker build -t morphq . | ||
``` | ||
|
||
1. To run the Docker container, run the following command: | ||
```bash | ||
docker run -it --rm -p 8888:8888 morphq | ||
``` | ||
|
||
|
||
### LEVEL 1: Reproduce the Paper Figures | ||
|
||
1. To run the run the notebook in the Docker container, run the following command: | ||
```bash | ||
jupyter notebook --allow-root --no-browser --ip=0.0.0.0 --port=8888 | ||
``` | ||
1. Then open the link that is printed in the terminal in your browser. Note that the link will look something like this: `http://127.0.0.1:8888/?token=6819f647f19859d9e92013a41f52f49d6ffed633e7b68657`. | ||
1. Open the `notebooks/RQs_Reproduce_Analysis_Results_Level_1.ipynb` notebook. | ||
1. Run the notebook top-to-bottom. | ||
1. Congratulations! You reproduced all the paper figures based on our experimental data. | ||
|
||
|
||
### LEVEL 2: Run MorphQ For a New Testing Campaign | ||
|
||
1. Generate a new configuration file with the following command: | ||
```bash | ||
python3 -m lib.generate_new_config --version 01 | ||
``` | ||
1. Select `morphq_demo.yaml` as the base configuration file. | ||
1. Run the following command to run MorphQ with the new configuration: | ||
```bash | ||
python3 -m lib.qmt config/qmt_v01.yaml | ||
``` | ||
1. Congratulations! You successfully run MorphQ. | ||
|
||
Note that your newly generated data will be transient in this Docker, thus if you are interested in accessing them you either need to mount a volume or copy the data folder with `docker cp`. | ||
|
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,75 @@ | ||
FROM ubuntu:22.04 | ||
|
||
WORKDIR /root/ | ||
|
||
# Install OS dependencies | ||
# Many of these are for blender, where we got the full list from: | ||
# https://wiki.blender.org/wiki/Building_Blender/Linux/Ubuntu | ||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
wget \ | ||
xz-utils \ | ||
build-essential \ | ||
git subversion \ | ||
cmake \ | ||
libx11-dev \ | ||
libxxf86vm-dev \ | ||
libxcursor-dev \ | ||
libxi-dev \ | ||
libxrandr-dev \ | ||
libxinerama-dev \ | ||
libegl-dev && \ | ||
apt-get clean | ||
|
||
|
||
|
||
# Download and install Anaconda | ||
RUN wget https://repo.anaconda.com/archive/Anaconda3-2022.10-Linux-x86_64.sh -O Anaconda3-2022.10-Linux-x86_64.sh | ||
RUN bash Anaconda3-2022.10-Linux-x86_64.sh -b | ||
RUN rm Anaconda3-2022.10-Linux-x86_64.sh | ||
|
||
ENV PATH=/root/anaconda3/bin:$PATH | ||
|
||
# Install unzip | ||
RUN apt-get install unzip | ||
|
||
# Move to the opt directory | ||
WORKDIR /opt/ | ||
|
||
# Download the environment.yml file | ||
RUN wget https://raw.githubusercontent.com/sola-st/MorphQ-Quantum-Qiskit-Testing-ICSE-23/main/environment.yml | ||
|
||
# Install Python dependencies | ||
RUN conda env create -f environment.yml | ||
|
||
# Initialize the bash | ||
RUN conda init bash | ||
|
||
# Create data directory | ||
RUN mkdir data | ||
|
||
# Download Data | ||
RUN wget -O data/figshare_data --no-check-certificate https://ndownloader.figshare.com/files/38923367/2 | ||
|
||
# Unzip Data | ||
RUN unzip data/figshare_data -d data/ | ||
RUN mv data/morphq_evaluation_compressed/qmt_v52 data/qmt_v52 | ||
RUN mv data/morphq_evaluation_compressed/qmt_v53 data/qmt_v53 | ||
|
||
|
||
# Initialize the sh | ||
RUN conda init bash | ||
# activate MorphQ environment | ||
RUN /bin/bash -c conda activate MorphQ | ||
|
||
# Copy MorphQ files | ||
COPY . /opt/ | ||
|
||
SHELL ["/bin/bash","-c"] | ||
RUN conda init | ||
RUN echo 'conda activate MorphQ' >> ~/.bashrc | ||
|
||
# Run the container and open jupyter notebook | ||
EXPOSE 8888 | ||
# start bash | ||
CMD ["/bin/bash"] |
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