Skip to content

Commit

Permalink
Merge pull request #62 from qBraid/rh1-docker-test
Browse files Browse the repository at this point in the history
test-container fixes
  • Loading branch information
ryanhill1 authored Mar 4, 2024
2 parents a1d2ba0 + 9f37962 commit 8663af1
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 53 deletions.
20 changes: 10 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Before you start working on a new feature or a fix, here's how you can contribut

### Development install

```bash
```shell
git clone https://github.com/qBraid/qbraid-qir.git
cd qbraid-qir
pip install -e '.[dev]'
Expand All @@ -31,13 +31,13 @@ Workflow: [`main.yml`](.github/workflows/main.yml)

Install pytest:

```bash
```shell
pip install qbraid pytest pytest-cov
```

Run unit tests:

```bash
```shell
pytest tests
```

Expand All @@ -63,26 +63,26 @@ to specify attributes, arguments, exceptions, returns, and other related info. T

Install sphinx and other docs requirements:

```bash
```shell
pip install -r docs/requirements.txt
```

or

```bash
```shell
pip install -e '.[docs]'
```

Then, build docs with:

```bash
```shell
cd docs
make html
```

View docs in local browser window:

```bash
```shell
open build/html/index.html
```

Expand All @@ -98,20 +98,20 @@ and [black](https://github.com/psf/black). Specific configurations for these too

Install linters:

```bash
```shell
pip install 'black[jupyter]' isort pylint
```

Run the following and make changes as needed to satisfy format checks:

```bash
```shell
black qbraid_qir tests examples
isort qbraid_qir tests
pylint qbraid_qir tests
```

Add licensing headers to all files:

```bash
```shell
python3 tools/verify_headers.py --fix
```
2 changes: 1 addition & 1 deletion qbraid_qir/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
Version number (major.minor.patch[-label])
"""
__version__ = "0.1.1.dev"
__version__ = "0.1.1"
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# unit tests
qbraid==0.5.2.dev20240304162946
qbraid
pytest
pytest-cov

Expand Down
10 changes: 5 additions & 5 deletions test-containers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ with the [qir-runner](https://github.com/qir-alliance/qir-runner/tree/main) pack

Build the QIR runner image:

```bash
```shell
docker build -t qbraid-test/qir-runner:latest qir_runner
```

Start the container running a Jupyter Server with the JupyterLab frontend and expose the container's internal port `8888` to port `8888` of the host machine:

```bash
```shell
docker run -p 8888:8888 qbraid-test/qir-runner:latest
```

Expand All @@ -28,15 +28,15 @@ Visiting `http://<hostname>:8888/?token=<token>` in a browser will launch Jupyte

Alternatively, you can open a shell inside the running container directly:

```bash
```shell
docker exec -it <container_name> /bin/bash
```

### Testing

Once inside the container, the `qir-runner` executable is accessible via command-line:

```bash
```shell
Usage: qir-runner [OPTIONS] --file <PATH>

Options:
Expand Down Expand Up @@ -68,6 +68,6 @@ dumps(module)

And then execute the QIR program:

```bash
```shell
qir-runner -f bell.bc
```
4 changes: 3 additions & 1 deletion test-containers/qir_runner/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (C) 2024 qBraid Development Team.
# Distributed under terms of the GNU General Public License v3.
FROM jupyter/minimal-notebook:latest
FROM jupyter/minimal-notebook:x86_64-python-3.11.6

USER root

Expand Down Expand Up @@ -80,4 +80,6 @@ RUN cargo install llvmenv && \

ENV PATH="/opt/qir-runner/target/release:${PATH}"

RUN pip install --no-cache-dir qbraid-qir cirq

WORKDIR $HOME
35 changes: 0 additions & 35 deletions test-containers/qir_runner/get-wheel.sh

This file was deleted.

0 comments on commit 8663af1

Please sign in to comment.