Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor client and fix tests #1513

Merged
merged 26 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
76a3349
refactor client and fix tests
korgan00 Oct 10, 2024
d8595f6
remove client/arguments.serverless
korgan00 Oct 10, 2024
41e9de0
remove unused TIMEOUTs
korgan00 Oct 11, 2024
3df8944
functions deprecation warnings
korgan00 Oct 11, 2024
204510b
added get_job_by_id with deprecation warning
korgan00 Oct 11, 2024
ba6684c
added __init__.py
korgan00 Oct 11, 2024
a3c0809
deprecated list function correction
korgan00 Oct 11, 2024
fd77ab2
replace deleted _token with token
korgan00 Oct 11, 2024
5149fed
**kwargs
korgan00 Oct 11, 2024
ad24a13
add duplicate code exception
korgan00 Oct 11, 2024
f289a7e
fixed run function
korgan00 Oct 11, 2024
8dc49bd
fixed code quality
korgan00 Oct 11, 2024
c6bf152
fix linter
korgan00 Oct 14, 2024
7d7d7db
delete file management from client. Use it only in serverless
korgan00 Oct 14, 2024
1918dc3
fix docs
korgan00 Oct 14, 2024
3e55964
skip file download and manage data directory tests
korgan00 Oct 14, 2024
164ce73
change docker build
korgan00 Oct 14, 2024
47e33e8
change docker build
korgan00 Oct 14, 2024
9ae1121
fix from_dict
korgan00 Oct 15, 2024
92ac23b
Merge branch 'main' into client-refactor
korgan00 Oct 17, 2024
706eead
move _upload_with_artifact changes
korgan00 Oct 17, 2024
8e083aa
rename get_XXXX methods as XXXX
korgan00 Oct 17, 2024
c3477e9
rename get_XXXX methods as XXXX on local client
korgan00 Oct 17, 2024
57e3334
fix upload return on serverless
korgan00 Oct 17, 2024
7402e53
fix upload return on local client
korgan00 Oct 17, 2024
0d48830
Merge branch 'main' into client-refactor
korgan00 Oct 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/docker-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ jobs:
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- name: Build the function
run: docker build -t test_function:latest --build-arg TARGETARCH="amd64" -f ./tests/basic/function/Sample-Docker ./tests/basic
- name: Build the containers
run: docker compose -f docker-compose-dev.yaml build
- name: Run the jupyter profile
Expand All @@ -29,6 +27,7 @@ jobs:
shell: bash
run: |
cd tests/basic
rm ./06_function.py
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes were necessary. Basically currently 06_function doesn't work in this test with the current docker-compose configuration and it was generating problems in the execution of the test.

for f in *.py; do echo "$f" && python "$f" &>> basic.log; done
done=$(cat basic.log | grep -c "DONE")
if [[ $done == 4 ]]
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/notebook-local-verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:
for f in tests/basic/*.py; do sed -i "s/import ServerlessClient/import LocalClient/;s/= ServerlessClient(/= LocalClient(/;/token=os\.environ\.get/d;/host=os\.environ\.get/d" "$f"; done
for f in tests/experimental/*.py; do sed -i "s/import ServerlessClient/import LocalClient/;s/= ServerlessClient(/= LocalClient(/;/token=os\.environ\.get/d;/host=os\.environ\.get/d" "$f"; done
rm tests/basic/06_function.py
rm tests/experimental/file_download.py
rm tests/experimental/manage_data_directory.py
- name: install dependencies
shell: bash
run: pip install client/
Expand Down
5 changes: 0 additions & 5 deletions client/qiskit_serverless/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,15 @@
from importlib_metadata import version as metadata_version, PackageNotFoundError

from .core import (
BaseProvider,
BaseClient,
distribute_task,
distribute_qiskit_function,
get,
put,
get_refs_by_status,
ServerlessProvider,
ServerlessClient,
IBMServerlessProvider,
IBMServerlessClient,
RayProvider,
RayClient,
LocalProvider,
LocalClient,
save_result,
Configuration,
Expand Down
26 changes: 5 additions & 21 deletions client/qiskit_serverless/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@
BaseClient
RayClient
LocalClient
ComputeResource
Job
GatewayJobClient
BaseJobClient
RayJobClient
save_result
QiskitPattern
QiskitFunction
Expand All @@ -51,25 +47,13 @@

"""

from .client import (
BaseProvider,
BaseClient,
ComputeResource,
ServerlessProvider,
ServerlessClient,
IBMServerlessProvider,
IBMServerlessClient,
LocalProvider,
LocalClient,
RayProvider,
RayClient,
)
from .client import BaseClient

from .clients.local_client import LocalClient
from .clients.ray_client import RayClient
from .clients.serverless_client import ServerlessClient, IBMServerlessClient

from .job import (
BaseJobClient,
RayJobClient,
GatewayJobClient,
LocalJobClient,
Job,
save_result,
Configuration,
Expand Down
Loading