Enables a local backend for ServiceX
Project description
ServiceX-Local
A drop in to enable local running of the ServiceX codegen and science images. This is mostly geared toward running for debugging and testing.
Installation
Install this as a library in your virtual environment with:
pip install servicex-localfor all the Docker based codegen and science container access.pip install servicex-local[xAOD]to get a local xAOD code generator (and the required dependencies) along with the docker based code.
Some science images requires a x509 certificate to run. You'll need to get the x509up into your /tmp area. If you don't have the tools installed locally, do the following:
- Make sure in your
~/.globusdirectory (on whatever OS you are no) contains theusercert.pemanduserkey.pemfiles - Use the
voms_proxy_initto initialize against theatlasvoms.
The science image code will pick up the location of the 509 cert.
Usage
Certificates
This will do its best to track x509 certs. If a file called x509up is located in your temp directory (including on windows), that will be copied into the docker image or other places to be used.
Example Code
This text is a DRAFT
To use this, example code is as follows:
codegen = LocalXAOD()
science_runner = ScienceWSL2("atlas_al9", "22.2.107")
adaptor = SXLocalAdaptor(codegen, science_runner)
# The simple query, take straight from the example in the documentation.
query = q.FuncADL_ATLASr22() # type: ignore
jets_per_event = query.Select(lambda e: e.Jets("AnalysisJets"))
jet_info_per_event = jets_per_event.Select(
lambda jets: {
"pt": jets.Select(lambda j: j.pt()),
"eta": jets.Select(lambda j: j.eta()),
}
)
spec = {
"Sample": [
{
"Name": "func_adl_xAOD_simple",
"Dataset": dataset.FileList(
[
"tests/test.root", # noqa: E501
]
),
"Query": jet_info_per_event,
}
]
}
files = deliver(spec, servicex_name="servicex-uc-af", sx_adaptor=adaptor)
assert files is not None, "No files returned from deliver! Internal error"
Running tests
If you are on a machine with wsl2 and or docker you can run the complete set of tests with flags:
pytest --wsl2 --docker
Acknowledgments
This docker versions of this code are thanks to @ketan96-m's work on this Service MR.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file servicex_local-1.0.0b8.tar.gz.
File metadata
- Download URL: servicex_local-1.0.0b8.tar.gz
- Upload date:
- Size: 15.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d21ca3c59143d79dfbce002f6e928c1959b52a99ec7cc58ead7da24188ebe905
|
|
| MD5 |
907923e36c7fa10fb361152fa3d83137
|
|
| BLAKE2b-256 |
c76b11513c1e70a392f745d21ffa0c3d602abaef9037f65ea73a664f351596e7
|
Provenance
The following attestation bundles were made for servicex_local-1.0.0b8.tar.gz:
Publisher:
pypi.yaml on gordonwatts/ServiceX-Local
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
servicex_local-1.0.0b8.tar.gz -
Subject digest:
d21ca3c59143d79dfbce002f6e928c1959b52a99ec7cc58ead7da24188ebe905 - Sigstore transparency entry: 585180647
- Sigstore integration time:
-
Permalink:
gordonwatts/ServiceX-Local@7751c46e4aaf34e2b3f13cb73f2a4cdcaf724aeb -
Branch / Tag:
refs/tags/1.0.0b8 - Owner: https://github.com/gordonwatts
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yaml@7751c46e4aaf34e2b3f13cb73f2a4cdcaf724aeb -
Trigger Event:
release
-
Statement type:
File details
Details for the file servicex_local-1.0.0b8-py3-none-any.whl.
File metadata
- Download URL: servicex_local-1.0.0b8-py3-none-any.whl
- Upload date:
- Size: 18.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78b1ef39e558211487f1e3f09d59107860cd6eb04c0c299fa8407671e84fa69e
|
|
| MD5 |
c95fa61dd95f046e33521e618dff0be2
|
|
| BLAKE2b-256 |
34ee1d427454ae3ea459c5f25d2febe2fae8a7486d78dacb753548a6a2801b5b
|
Provenance
The following attestation bundles were made for servicex_local-1.0.0b8-py3-none-any.whl:
Publisher:
pypi.yaml on gordonwatts/ServiceX-Local
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
servicex_local-1.0.0b8-py3-none-any.whl -
Subject digest:
78b1ef39e558211487f1e3f09d59107860cd6eb04c0c299fa8407671e84fa69e - Sigstore transparency entry: 585180649
- Sigstore integration time:
-
Permalink:
gordonwatts/ServiceX-Local@7751c46e4aaf34e2b3f13cb73f2a4cdcaf724aeb -
Branch / Tag:
refs/tags/1.0.0b8 - Owner: https://github.com/gordonwatts
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yaml@7751c46e4aaf34e2b3f13cb73f2a4cdcaf724aeb -
Trigger Event:
release
-
Statement type: