Skip to content

Commit

Permalink
change artifact/ to artifacts/
Browse files Browse the repository at this point in the history
  • Loading branch information
oeway committed Oct 10, 2024
1 parent 880fb97 commit 0875c2b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- Breaking Change: Remove `info`, `warning`, `error`, `critical`, `debug` from the `hypha` module, use `log` or `log_event` instead.
- Support basic observability for the workspace, including workspace status, event bus and websocket connection status.
- Support download statistics for the artifacts in the artifact manager.
- Change http endpoint from `/{workspace}/artifact/{artifact_id}` to `/{workspace}/artifacts/{artifact_id}` to make it consistent with the other endpoints.

### 0.20.37
- Add s3-proxy to allow accessing s3 presigned url in case the s3 server is not directly accessible. Use `--enable-s3-proxy` to enable the s3 proxy when starting Hypha.
Expand Down
4 changes: 2 additions & 2 deletions docs/artifact-manager.md
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ print("Download statistics reset.")

The `Artifact Manager` provides an HTTP endpoint for retrieving artifact manifests, data, and download statistics. This is useful for public-facing web applications that need to access datasets, models, or applications.

### Endpoint: `/{workspace}/artifact/{path:path}`
### Endpoint: `/{workspace}/artifacts/{path:path}`

- **Workspace**: The workspace in which the artifact is stored.
- **Path**: The relative path to the artifact. For private artifacts, it requires proper authentication by passing the user's token in the request headers.
Expand All @@ -511,7 +511,7 @@ import requests

SERVER_URL = "https://hypha.aicell.io"
workspace = "my-workspace"
response = requests.get(f"{SERVER_URL}/{workspace}/artifact/collections/dataset-gallery/example-dataset")
response = requests.get(f"{SERVER_URL}/{workspace}/artifacts/collections/dataset-gallery/example-dataset")
if response.ok:
artifact = response.json()
print(artifact["name"]) # Output: Example Dataset
Expand Down
2 changes: 1 addition & 1 deletion hypha/VERSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "0.20.38.post2"
"version": "0.20.38.post3"
}
2 changes: 1 addition & 1 deletion hypha/artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def __init__(

router = APIRouter()

@router.get("/{workspace}/artifact/{path:path}")
@router.get("/{workspace}/artifacts/{path:path}")
async def get_artifact(
workspace: str,
path: str,
Expand Down
6 changes: 3 additions & 3 deletions tests/test_artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ async def test_serve_artifact_endpoint(minio_server, fastapi_server):

# Ensure the public artifact is available via HTTP
response = requests.get(
f"{SERVER_URL}/{api.config.workspace}/artifact/public/collections/dataset-gallery/public-example-dataset"
f"{SERVER_URL}/{api.config.workspace}/artifacts/public/collections/dataset-gallery/public-example-dataset"
)
assert response.status_code == 200
assert "Public Example Dataset" in response.json()["name"]
Expand Down Expand Up @@ -111,7 +111,7 @@ async def test_serve_artifact_endpoint(minio_server, fastapi_server):
token = await api.generate_token()
# Ensure the private artifact is available via HTTP (requires authentication or special permissions)
response = requests.get(
f"{SERVER_URL}/{api.config.workspace}/artifact/collections/private-dataset-gallery/private-example-dataset",
f"{SERVER_URL}/{api.config.workspace}/artifacts/collections/private-dataset-gallery/private-example-dataset",
headers={"Authorization": f"Bearer {token}"},
)

Expand All @@ -120,7 +120,7 @@ async def test_serve_artifact_endpoint(minio_server, fastapi_server):

# If no authentication is provided, the server should return a 401 Unauthorized status code
response = requests.get(
f"{SERVER_URL}/{api.config.workspace}/artifact/collections/private-dataset-gallery/private-example-dataset"
f"{SERVER_URL}/{api.config.workspace}/artifacts/collections/private-dataset-gallery/private-example-dataset"
)
assert response.status_code == 403

Expand Down

0 comments on commit 0875c2b

Please sign in to comment.