Skip to main content

No project description provided

Project description

outpack

Project Status: Concept – Minimal or no implementation has been done yet, or the repository is only intended to be a limited example, demo, or proof-of-concept.

Rust implementation of outpack.

Usage

This crate provides an outpack command which can be used to create and operate on Outpack repositories.

The command can be built with cargo build, after which it can be found in target/debug/outpack. Alternatively it can be started directly by using cargo run.

Initializing a new repository

outpack init --use-file-store <path>

Query CLI usage

outpack query --root <path> <query>

API Server

The outpack command includes an API server which can be used to expose the repository over an HTTP interface.

outpack start-server --root <path>

Usage of docker image

docker run --name outpack_server -v /full/path/to/root:/outpack -p 8000:8000 -d mrcide/outpack_server:main

Schema

The outpack schema is imported into this package by running ./scripts/import_schema, and needs to be kept manually up to date by re-running that script as needed.

Tests

Run all tests with cargo test.

API

GET /

{
   "status": "succcess",
   "data": {
        "schema_version": "0.0.1"
   },
   "errors": null
}

GET /checksum

Returns hash of all current packet ids, ordered alphanumerically and concatenated. This will use the hashing algorithm specified in the outpack config, unless a query parameter specifying an alternative is passed: e.g. /checksum?alg=md5.

{
   "status": "succcess",
   "data": "md5:117723186364b4b409081b1bd347d406"
   "errors": null
}

GET /metadata/list

{
    "status": "success",
    "errors": null,
    "data": [
        {
            "packet": "20220812-155808-c873e405",
            "time": "2022-08-12 15:58:08",
            "hash": "sha256:df6edb3d6cd50f5aec9308a357111592cde480f45a5f46341877af21ae30d93e"
        },
        {
            "packet": "20220812-155808-d5747caf",
            "time": "2022-08-12 15:58:08",
            "hash": "sha256:edc70ef51e69f2cde8238142af29a9419bb27c94b320b87e88f617dfc977a46b"
        },
        {
            "packet": "20220812-155808-dbd3ce81",
            "time": "2022-08-12 15:58:08",
            "hash": "sha256:a7da8c3464a2da4722b9d15daa98eb13f4f8c1949c6d00100428b2e9d0668f29"
        },
        {
            "packet": "20220812-155808-e21bc5fc",
            "time": "2022-08-12 15:58:08",
            "hash": "sha256:df1b91aaf3393483515ac61596aa35117891eacc533a55ec2f4759d0036514f9"
        }
    ]
}

GET /packit/metadata

Returns a list of (truncated) packet metadata. Accepts an optional query parameter known_since specifying a Unix epoch time from which to return results. This will filter packets by the time property of the location metadata, i.e. the point at which they were inserted into the index. e.g. /packit/metadata?known_since=1683117048.

{
    "status": "success",
    "errors": null,
    "data": [
        {
            "id": "20220812-155808-c873e405",
            "name": "depends",
            "custom": { "orderly": { "display": "Report with dependencies" }}
            "parameters": null
        },
        {
            "id": "20220812-155808-d5747caf",
            "name": "params",
            "custom": { "orderly": { "display": "Report with parameters" }},
            "parameters": { "alpha": 1 }
        }
    ]
}

GET /metadata/<id>/json

{
  "status": "success",
  "errors": null,
  "data": {
    "custom": null,
    "depends": [],
    "files": [
      {
        "hash": "sha256:e9aa9f2212aba6fba4464212800a2927afa02eda688cf13131652da307e3d7c1",
        "path": "orderly.yml",
        "size": 955
      },
      {
        "hash": "sha256:11a2cd93493defa673b198d5be7a180cef7b133baaacc046923e1e2da77c6f75",
        "path": "modified_update.R",
        "size": 1133
      },
      {
        "hash": "sha256:c4d4c95af9da912f2f20c65a0502c7da19a5712767a39e07a2dd1ea7fcb615b0",
        "path": "R/util.R",
        "size": 2757
      }
    ],
    "id": "20170818-164043-7cdcde4b",
    "name": "modup-201707",
    "parameters": null,
    "schema_version": "0.0.1",
    "script": [
      "modified_update.R"
    ],
    "session": {
      "packages": [
        {
          "attached": true,
          "package": "RcppRoll",
          "version": "0.2.2"
        },
        {
          "attached": false,
          "package": "Rcpp",
          "version": "0.12.12"
        },
        {
          "attached": false,
          "package": "ids",
          "version": "1.0.1"
        }
      ],
      "platform": {
        "os": "Debian GNU/Linux 9 (stretch)",
        "system": "x86_64, linux-gnu",
        "version": "R version 3.4.0 (2017-04-21)"
      }
    },
    "time": {
      "end": 1503074545.8687,
      "start": 1503074545.8687
    }
  }
}

GET /metadata/<id>/text

Returns the same as GET /metadata/<id>/json but just the data as plain text.

GET /file/<hash>

Downloads the file with the provided hash. 404 if it doesn't exist.

POST /packets/missing

Body

{
    "ids": ["20220812-155808-c873e405","20220812-155808-d5747caf"],
    "unpacked": false
}

Given a list of ids, returns those that are missing in the current root. If unpacked is true returns missing unpacked packets, otherwise just looks at missing metadata.

Response

{
  "status": "success",
  "errors": null,
  "data": ["20220812-155808-c873e405", "20220812-155808-d5747caf"]
}

POST /files/missing

Body

{
  "hashes": [
    "sha256:b189579a9326f585d308304bd9e03326be5d395ac71b31df359ab8bac408d248",
    "sha256:a189579a9326f585d308304bd9e03326be5d395ac71b31df359ab8bac408d247"
  ]
}

Given a list of file hashes, returns those that are missing in the current root.

Response

{
  "status": "success",
  "errors": null,
  "data": ["sha256:a189579a9326f585d308304bd9e03326be5d395ac71b31df359ab8bac408d24"]
}

POST /file/

Upload a file with the given hash. Returns a 400 if the hash does not match the file contents. This method is idempotent; if the file already exists it will not do anything.

Body

The file contents should be written directly to the request body.

Response

{
  "status": "success",
  "errors": null,
  "data": null
}

POST /packet/

Upload packet metadata with the given hash. Returns a 400 if the hash does not match the contents. This method is idempotent; if the file already exists it will not do anything.

Body

The metadata should be written directly to the request body.

Response

{
  "status": "success",
  "errors": null,
  "data": null
}

Python bindings

This crate provides Python bindings for its query parser. The bindings can be installed using pip install ..

Local development

hatch run python  # Start a Python interpreter with the bindings installed
hatch run test    # Run the bindings test-suite
hatch run develop # Rebuild the bindings. Necessary whenever changes to Rust code is made.

License

MIT © Imperial College of Science, Technology and Medicine

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

outpack_query_parser-0.3.0.tar.gz (64.3 kB view details)

Uploaded Source

Built Distributions

outpack_query_parser-0.3.0-cp38-abi3-win_amd64.whl (223.1 kB view details)

Uploaded CPython 3.8+ Windows x86-64

outpack_query_parser-0.3.0-cp38-abi3-win32.whl (211.4 kB view details)

Uploaded CPython 3.8+ Windows x86

outpack_query_parser-0.3.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ x86-64

outpack_query_parser-0.3.0-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl (1.3 MB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ i686

outpack_query_parser-0.3.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.2 MB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ ARM64

outpack_query_parser-0.3.0-cp38-abi3-macosx_11_0_arm64.whl (359.1 kB view details)

Uploaded CPython 3.8+ macOS 11.0+ ARM64

outpack_query_parser-0.3.0-cp38-abi3-macosx_10_7_x86_64.whl (368.7 kB view details)

Uploaded CPython 3.8+ macOS 10.7+ x86-64

File details

Details for the file outpack_query_parser-0.3.0.tar.gz.

File metadata

  • Download URL: outpack_query_parser-0.3.0.tar.gz
  • Upload date:
  • Size: 64.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for outpack_query_parser-0.3.0.tar.gz
Algorithm Hash digest
SHA256 e72381f77c3f2c27856a0a4474a86696d27093b34b458a59bfb059e4d5c76bd5
MD5 1e6f27c209c89dbdb7ff5abb38c9ed6b
BLAKE2b-256 4f9ab9b7a0a78ffa83307f6ceea6ba635b5c455155a3530064e637f428c50347

See more details on using hashes here.

File details

Details for the file outpack_query_parser-0.3.0-cp38-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for outpack_query_parser-0.3.0-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 2f38ee4c8ec72d9803b1b0bc3a6fecc9985a36d898b3a8c077c418339043a1ef
MD5 7e63612650958d25738676a9680b0dac
BLAKE2b-256 ac21c0029db128be8313d6fdcd19430c733e6cddb41bc83d47095ea28e134143

See more details on using hashes here.

File details

Details for the file outpack_query_parser-0.3.0-cp38-abi3-win32.whl.

File metadata

File hashes

Hashes for outpack_query_parser-0.3.0-cp38-abi3-win32.whl
Algorithm Hash digest
SHA256 efde08fee2325cafb50899c2b51969667c002f0411a5ceac24cf82582ffac02c
MD5 777c05110c0d13a5c097362cfd2f925f
BLAKE2b-256 0d6204470d95b37bef2244d234d7640ce7d2e3f8f776ae0a0775c86df5bfe3ae

See more details on using hashes here.

File details

Details for the file outpack_query_parser-0.3.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for outpack_query_parser-0.3.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7f004bc36402bb0354e503a0ad1d32229649787b461fd8e57e1e79be0b34d92d
MD5 33859f06f07c00bcf67138ce14550bc6
BLAKE2b-256 1edefb4a801281a0d4d3dc1486b21bdf2ba65a205082883afa9668e2f85f52d5

See more details on using hashes here.

File details

Details for the file outpack_query_parser-0.3.0-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for outpack_query_parser-0.3.0-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 b17ef9aff4d26ad3e6d8c3ce40c4d0f2a72b9c9a78076bb1649096dd1bd7ebe0
MD5 6f7b7edbb9b2587965722d5342ed21e1
BLAKE2b-256 1302c5c0a1ace53ffc985b9d2f8bbb88ddd2873003a6eebfb506ed55fbd7f79c

See more details on using hashes here.

File details

Details for the file outpack_query_parser-0.3.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for outpack_query_parser-0.3.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 718acfc4601052776eb9e20ebc0396fa644c7d7d7b57a6e2afbf42f94db87921
MD5 61d59cfa8bee5c951ac7ac96102b318b
BLAKE2b-256 2bd104730a97958d7ba0d4b42443c833e207652f979a2177937980c872e5ca9a

See more details on using hashes here.

File details

Details for the file outpack_query_parser-0.3.0-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for outpack_query_parser-0.3.0-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1c73f081ffbf8e0d0a01e4462d57d274e609edbe1e861496e2ba3c4bd5608cc6
MD5 f030867a566b4a9962e05630582a7178
BLAKE2b-256 3ac89b74dcc61154deedcb1097dca34664014cbe5ceda187333f3b5001b0cbc9

See more details on using hashes here.

File details

Details for the file outpack_query_parser-0.3.0-cp38-abi3-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for outpack_query_parser-0.3.0-cp38-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 fa825f7dcd008eb35b66c3417ba6e19fb3f95527b8ff05ebbb070d73fad9dbc0
MD5 6e423147ab402b81eb53abaf44f81698
BLAKE2b-256 1eb1f268ebb52550aa78953cd657611a91f3141e14acf80f53550686fd92dd5d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page