Skip to content

Conversation

@dvlpwork
Copy link
Collaborator

@dvlpwork dvlpwork commented Nov 13, 2025

πŸ“ƒ Ticket

#315

✍ Description

Build minio locally and the backend uses it.

πŸ“Έ Test Result

POST http://0.0.0.0:8080/jobs

request body:

{
    "name": "Bell State Sampling",
    "description": "Bell State Sampling Example",
    "device_id": "Kawasaki",
    "job_type": "sse",
    "job_info": {
        "program": [
            "OPENQASM 3; qubit[2] q; bit[2] c; h q[0]; cnot q[0], q[1]; c = measure q;"
        ]
    },
    "transpiler_info": {},
    "simulator_info": {
        "n_qubits": 5,
        "n_nodes": 12,
        "n_per_node": 2,
        "seed_simulation": 39058567,
        "simulation_opt": {
            "optimization_method": "light",
            "optimization_block_size": 1,
            "optimization_swap_level": 1
        }
    },
    "mitigation_info": {},
    "shots": 1000
}

response:

{
    "job_id": "06915b2d-0c12-7178-8000-be2b5e7228e1"
}

On minio Web GUI:
minio web gui

Note

On the other hand, I found some problems with calling jobs API when I test minio.

Compare username with email

On localhost, username (event.state.owner) will be set as "admin."

try:
if os.getenv("ENV") == "local":
request.state.owner = "admin"
else:
owner = APIGatewayProxyEvent(
request.scope["aws.event"]
).request_context.authorizer["owner"]
request.state.owner = owner
except KeyError:
logger.error("No AWS event found in request scope")
raise HTTPException(
status_code=500, detail="No AWS event found in request scope"
)

However, the comparison target is email.

# username here is the email address registered in Cognito
user = db.scalars(select(User).where(User.email == username)).first()

Therefore, admin is not allowed to use any devices.

For the test, I changed as below:

        user = db.scalars(select(User).where(User.username == username)).first()

base64 encoding error with QASM

QASM string failed to decode with the following error:

"/path/to/oqtopus-cloud/backend/oqtopus_cloud/user/routers/jobs.py", line 494, in put_user_program_to_s3
 decoded_program = base64.b64decode(job_info.program[0])
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/path/to/.pyenv/versions/3.12.3/lib/python3.12/base64.py", line 88, in b64decode
 return binascii.a2b_base64(s, strict_mode=validate)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
binascii.Error: Invalid base64-encoded string: number of data characters (41) cannot be 1 more than a multiple of 4

decoded_program = base64.b64decode(job_info.program[0])

I prevented this problem by changing the code as below:

        decoded_program = job_info.program[0].encode("utf-8")

@dvlpwork dvlpwork self-assigned this Nov 13, 2025
@github-actions github-actions bot added bugfix Bug fixes chore Minor changes or maintenance tasks feature Adding a new feature labels Nov 13, 2025
@dvlpwork dvlpwork marked this pull request as ready for review November 13, 2025 11:22
@dvlpwork dvlpwork linked an issue Nov 13, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Bug fixes chore Minor changes or maintenance tasks feature Adding a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Build minio by ourselves

2 participants