Skip to content

Commit

Permalink
squash - review tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
trel committed Nov 20, 2023
1 parent 00b830f commit a5761fb
Showing 1 changed file with 28 additions and 14 deletions.
42 changes: 28 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,47 @@ A project that presents an iRODS Zone as HTTP v1.1.

## Quickstart (Running from Docker Hub Image)

1. Generate a local configuration JSON file.
Generate a local configuration JSON file.

```
docker run irods/irods_http_api --dump-config-template > config.json
docker run irods/irods_http_api \
--dump-config-template > config.json
```

2. Edit/update the template `config.json` file (point to your iRODS Zone, remove OIDC and TLS sections, etc.).
Edit/update the template `config.json` file (point to your iRODS Zone, remove OIDC and TLS sections, etc.).

```
vim config.json
```

3. Launch the HTTP API with your customized configuration file to check for success/errors:
Launch the HTTP API with your customized configuration file to check for success/errors:

```
docker run --rm --name irods_http_api -v ./config.json:/config.json:ro -p 9000:9000 irods/irods_http_api
docker run --rm --name irods_http_api \
-v ./config.json:/config.json:ro \
-p 9000:9000 \
irods/irods_http_api
```

4. Launch in daemonized form:
Launch in daemonized form:

```
docker run -d --rm --name irods_http_api -v ./config.json:/config.json:ro -p 9000:9000 irods/irods_http_api
docker run -d --rm --name irods_http_api \
-v ./config.json:/config.json:ro \
-p 9000:9000 \
irods/irods_http_api
```

Then, the HTTP API will be available:
```
$ curl -X POST -u rods:rods http://localhost:9000/irods-http-api/0.1.0/authenticate
$ curl -X POST -u rods:rods \
http://localhost:9000/irods-http-api/0.1.0/authenticate
568bbfc2-7d19-4723-b659-bb9325f9b076
$ curl -s http://localhost:9000/irods-http-api/0.1.0/collections \
-H 'Authorization: Bearer 568bbfc2-7d19-4723-b659-bb9325f9b076' \
--data-urlencode 'op=stat' \
--data-urlencode 'lpath=/tempZone/home/rods' -G | jq
-H 'Authorization: Bearer 568bbfc2-7d19-4723-b659-bb9325f9b076' \
--data-urlencode 'op=stat' \
--data-urlencode 'lpath=/tempZone/home/rods' -G | jq
{
"inheritance_enabled": false,
"irods_response": {
Expand Down Expand Up @@ -118,7 +126,8 @@ This project provides two Dockerfiles, one for building and one for running the

The builder image is responsible for building the iRODS HTTP API package. Before you can use it, you must build the image. To do that, run the following:
```bash
docker build -t irods-http-api-builder -f irods_builder.Dockerfile .
docker build -t irods-http-api-builder \
-f irods_builder.Dockerfile .
```

With the builder image in hand, all that's left is to get the source code for the GenQuery2 project and HTTP API project. The builder image is designed to compile code sitting on your machine. This is important because it gives you the ability to build any fork or branch of the projects.
Expand All @@ -140,7 +149,9 @@ The runner image is responsible for running the iRODS HTTP API. Building the run

To build the image, run the following command:
```bash
docker build -t irods-http-api-runner -f irods_runner.Dockerfile /path/to/packages/directory
docker build -t irods-http-api-runner \
-f irods_runner.Dockerfile \
/path/to/packages/directory
```

If all goes well, you will have a containerized iRODS HTTP API server! You can verify this by checking the version information. Below is an example.
Expand All @@ -155,7 +166,10 @@ To run the containerized server, you need to provide a configuration file at the

Assuming you have a valid configuration file, you can launch the server by running the following command:
```bash
docker run -d --rm --name irods_http_api -v /path/to/config/file:/config.json:ro -p 9000:9000 irods-http-api-runner
docker run -d --rm --name irods_http_api \
-v /path/to/config/file:/config.json:ro \
-p 9000:9000 \
irods-http-api-runner
```

You can view the log output using `docker logs -f` or by passing `-it` to `docker run` instead of `-d`.
Expand Down

0 comments on commit a5761fb

Please sign in to comment.