Skip to content

Commit 4a8b499

Browse files
authored
Merge pull request bluesky#1215 from bluesky/demo-url
Update demo URL
2 parents 9746553 + bbd327a commit 4a8b499

File tree

9 files changed

+58
-53
lines changed

9 files changed

+58
-53
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@ Write the date in place of the "Unreleased" in the case a new version is release
33

44
# Changelog
55

6+
## Unreleased
7+
8+
### Changed
9+
10+
- The public demo hosted by NSLS2 has moved from `tiled-demo.blueskyproject.io`
11+
to `tiled-demo.nsls2.bnl.gov`, for purely practical reasons. (It is easier to
12+
manage the deployment and associated certificates.) **The demo remains
13+
world-public, with no login required.** This change affects some
14+
documentation and one test.
15+
616
## v0.2.0 (2025-10-29)
717

818
### Added

docs/source/how-to/api-keys.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ is useful when:
4141

4242
To follow along, you may start a Tiled server with a simple authentication provider,
4343
as shown. Alternatively, you may use an existing authenticated Tiled server, such as
44-
`https://tiled-demo.blueskyproject.io`; if you do, replace `http://localhost:8000`
44+
`https://tiled-demo.nsls2.bnl.gov`; if you do, replace `http://localhost:8000`
4545
in the example below with that address.
4646

4747
```

docs/source/how-to/client-logger.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,22 @@ your program; it does not alter any global logging configuration.
2424
Requests (`->`) and responses (`<-`) will now be logged to the console, like so.
2525

2626
```py
27-
>>> c = from_uri("https://tiled-demo.blueskyproject.io")
28-
16:49:22.307 -> GET 'https://tiled-demo.blueskyproject.io/?root_path=true' 'host:tiled-demo.blueskyproject.io' 'accept:*/*' 'accept-encoding:gzip,blosc2' 'connection:keep-alive' 'user-agent:python-tiled/0.1.0a49'
27+
>>> c = from_uri("https://tiled-demo.nsls2.bnl.gov")
28+
16:49:22.307 -> GET 'https://tiled-demo.nsls2.bnl.gov/?root_path=true' 'host:tiled-demo.nsls2.bnl.gov' 'accept:*/*' 'accept-encoding:gzip,blosc2' 'connection:keep-alive' 'user-agent:python-tiled/0.1.0a49'
2929
16:49:22.486 <- 200 server:nginx/1.18.0 (Ubuntu) date:Tue, 01 Feb 2022 21:49:22 GMT content-type:application/json content-length:761 connection:keep-alive etag:35b70c6412c39db8b7b5132ddf61973c expires:Tue, 01 Feb 2022 21:59:22 GMT content-encoding:gzip vary:Accept-Encoding server-timing:tok;dur=0.1, pack;dur=0.0, compress;dur=0.1;ratio=3.1, app;dur=3.9 set-cookie:tiled_csrf=-fyaLez0YkradgcEVYBJh4QotR5MNyzouV0SV0NWHmM; HttpOnly; Path=/; SameSite=lax
30-
16:49:22.492 -> GET 'https://tiled-demo.blueskyproject.io/?root_path=true' 'host:tiled-demo.blueskyproject.io' 'accept:application/x-msgpack' 'accept-encoding:gzip,blosc2' 'connection:keep-alive' 'user-agent:python-tiled/0.1.0a49' 'cookie:tiled_csrf=-fyaLez0YkradgcEVYBJh4QotR5MNyzouV0SV0NWHmM'
30+
16:49:22.492 -> GET 'https://tiled-demo.nsls2.bnl.gov/?root_path=true' 'host:tiled-demo.nsls2.bnl.gov' 'accept:application/x-msgpack' 'accept-encoding:gzip,blosc2' 'connection:keep-alive' 'user-agent:python-tiled/0.1.0a49' 'cookie:tiled_csrf=-fyaLez0YkradgcEVYBJh4QotR5MNyzouV0SV0NWHmM'
3131
16:49:22.531 <- 200 server:nginx/1.18.0 (Ubuntu) date:Tue, 01 Feb 2022 21:49:22 GMT content-type:application/x-msgpack content-length:773 connection:keep-alive etag:35b70c6412c39db8b7b5132ddf61973c expires:Tue, 01 Feb 2022 21:59:22 GMT content-encoding:gzip vary:Accept-Encoding server-timing:tok;dur=0.1, pack;dur=0.0, compress;dur=0.1;ratio=2.7, app;dur=4.5
32-
16:49:22.535 -> GET 'https://tiled-demo.blueskyproject.io//metadata/' 'host:tiled-demo.blueskyproject.io' 'accept:application/x-msgpack' 'accept-encoding:gzip,blosc2' 'connection:keep-alive' 'user-agent:python-tiled/0.1.0a49' 'cookie:tiled_csrf=-fyaLez0YkradgcEVYBJh4QotR5MNyzouV0SV0NWHmM'
32+
16:49:22.535 -> GET 'https://tiled-demo.nsls2.bnl.gov//metadata/' 'host:tiled-demo.nsls2.bnl.gov' 'accept:application/x-msgpack' 'accept-encoding:gzip,blosc2' 'connection:keep-alive' 'user-agent:python-tiled/0.1.0a49' 'cookie:tiled_csrf=-fyaLez0YkradgcEVYBJh4QotR5MNyzouV0SV0NWHmM'
3333
16:49:22.572 <- 200 server:nginx/1.18.0 (Ubuntu) date:Tue, 01 Feb 2022 21:49:22 GMT content-type:application/x-msgpack content-length:292 connection:keep-alive etag:821dd2a8b431ecd016f94cacd44af74f server-timing:tok;dur=0.0, pack;dur=0.0, app;dur=3.8
3434

3535
>>> t = c['generated']['short_table']
36-
16:58:22.589 -> GET 'https://tiled-demo.blueskyproject.io/search/?filter%5Blookup%5D%5Bcondition%5D%5Bkey%5D=generated&sort=' 'host:tiled-demo.blueskyproject.io' 'accept:application/x-msgpack' 'accept-encoding:gzip,blosc2' 'connection:keep-alive' 'user-agent:python-tiled/0.1.0a49.post0.dev0+g6dd1e5f' 'cookie:tiled_csrf=-fyaLez0YkradgcEVYBJh4QotR5MNyzouV0SV0NWHmM'
36+
16:58:22.589 -> GET 'https://tiled-demo.nsls2.bnl.gov/search/?filter%5Blookup%5D%5Bcondition%5D%5Bkey%5D=generated&sort=' 'host:tiled-demo.nsls2.bnl.gov' 'accept:application/x-msgpack' 'accept-encoding:gzip,blosc2' 'connection:keep-alive' 'user-agent:python-tiled/0.1.0a49.post0.dev0+g6dd1e5f' 'cookie:tiled_csrf=-fyaLez0YkradgcEVYBJh4QotR5MNyzouV0SV0NWHmM'
3737
16:58:22.635 <- 200 server:nginx/1.18.0 (Ubuntu) date:Tue, 01 Feb 2022 21:58:22 GMT content-type:application/x-msgpack content-length:502 connection:keep-alive etag:53a7b8a84ec504259a8c29903a25ade0 server-timing:tok;dur=0.0, pack;dur=0.0, app;dur=5.9
38-
16:58:22.638 -> GET 'https://tiled-demo.blueskyproject.io/search/generated?filter%5Blookup%5D%5Bcondition%5D%5Bkey%5D=short_table&sort=' 'host:tiled-demo.blueskyproject.io' 'accept:application/x-msgpack' 'accept-encoding:gzip,blosc2' 'connection:keep-alive' 'user-agent:python-tiled/0.1.0a49.post0.dev0+g6dd1e5f' 'cookie:tiled_csrf=-fyaLez0YkradgcEVYBJh4QotR5MNyzouV0SV0NWHmM'
38+
16:58:22.638 -> GET 'https://tiled-demo.nsls2.bnl.gov/search/generated?filter%5Blookup%5D%5Bcondition%5D%5Bkey%5D=short_table&sort=' 'host:tiled-demo.nsls2.bnl.gov' 'accept:application/x-msgpack' 'accept-encoding:gzip,blosc2' 'connection:keep-alive' 'user-agent:python-tiled/0.1.0a49.post0.dev0+g6dd1e5f' 'cookie:tiled_csrf=-fyaLez0YkradgcEVYBJh4QotR5MNyzouV0SV0NWHmM'
3939
16:58:22.681 <- 200 server:nginx/1.18.0 (Ubuntu) date:Tue, 01 Feb 2022 21:58:22 GMT content-type:application/x-msgpack content-length:944 connection:keep-alive etag:8d81b7891000606ceeb87fa89689c045 content-encoding:gzip vary:Accept-Encoding server-timing:acl;dur=0.0, tok;dur=0.1, pack;dur=0.0, compress;dur=0.1;ratio=4.5, app;dur=12.0
4040

4141
>>> t.read()
42-
16:58:27.134 -> GET 'https://tiled-demo.blueskyproject.io/table/partition/generated/short_table?partition=0' 'host:tiled-demo.blueskyproject.io' 'accept:application/vnd.apache.arrow.file' 'accept-encoding:gzip,blosc2' 'connection:keep-alive' 'user-agent:python-tiled/0.1.0a49.post0.dev0+g6dd1e5f' 'cookie:tiled_csrf=-fyaLez0YkradgcEVYBJh4QotR5MNyzouV0SV0NWHmM'
42+
16:58:27.134 -> GET 'https://tiled-demo.nsls2.bnl.gov/table/partition/generated/short_table?partition=0' 'host:tiled-demo.nsls2.bnl.gov' 'accept:application/vnd.apache.arrow.file' 'accept-encoding:gzip,blosc2' 'connection:keep-alive' 'user-agent:python-tiled/0.1.0a49.post0.dev0+g6dd1e5f' 'cookie:tiled_csrf=-fyaLez0YkradgcEVYBJh4QotR5MNyzouV0SV0NWHmM'
4343
16:58:27.205 <- 200 server:nginx/1.18.0 (Ubuntu) date:Tue, 01 Feb 2022 21:58:27 GMT content-type:application/vnd.apache.arrow.file content-length:3847 connection:keep-alive etag:954688a8ef55915b012bba1e93769710 content-encoding:blosc2 vary:Accept-Encoding server-timing:acl;dur=0.0, read;dur=1.4, tok;dur=0.2, pack;dur=0.8, compress;dur=0.0;ratio=1.4, app;dur=9.1
4444
A B C
4545
index

docs/source/how-to/profiles.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ parameters in a file and gives them an alias, so that something like this:
99
from tiled.client import from_uri
1010
from tiled.client.cache import Cache
1111

12-
client = from_uri("https://tiled-demo.blueskyproject.io")
12+
client = from_uri("https://tiled-demo.nsls2.bnl.gov")
1313
```
1414

1515
can be replaced with the more memorable and succinct
@@ -24,7 +24,7 @@ client = from_profile("demo")
2424
## Create a profile
2525

2626
```
27-
$ tiled profile create --name demo https://tiled-demo.blueskyproject.io
27+
$ tiled profile create --name demo https://tiled-demo.nsls2.bnl.gov
2828
```
2929

3030
## Review and edit profiles

docs/source/reference/authentication.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ then, you can launch the server:
4040
ALICE_PASSWORD=secret1 BOB_PASSWORD=secret2 CARA_PASSWORD=secret3 tiled serve config example_configs/toy_authentication.yml
4141
```
4242

43-
To test the second kind, we'll use `https://tiled-demo.blueskyproject.io`, which
43+
To test the second kind, we'll use `https://tiled-demo.nsls2.bnl.gov`, which
4444
is configured to use [ORCID](https://orcid.org/) for authentication.
4545

4646
### Scenario 1: Authenticator Directly Handles Credentials
@@ -162,26 +162,26 @@ An initial handshake with the `/` route tells us that this server uses
162162
`"external"` authentication.
163163

164164
```
165-
$ http https://tiled-demo.blueskyproject.io/api/v1/ | jq .authentication.type
165+
$ http https://tiled-demo.nsls2.bnl.gov/api/v1/ | jq .authentication.type
166166
"external"
167167
```
168168

169169
Elsewhere in this same response, we can find the authentication endpoint for
170170
this external identity provider.
171171

172172
```
173-
$ http https://tiled-demo.blueskyproject.io/api/v1/ | jq .authentication.endpoint
174-
"https://orcid.org/oauth/authorize?client_id=APP-0ROS9DU5F717F7XN&response_type=code&scope=openid&redirect_uri=https://tiled-demo.blueskyproject.io/auth/code",
173+
$ http https://tiled-demo.nsls2.bnl.gov/api/v1/ | jq .authentication.endpoint
174+
"https://orcid.org/oauth/authorize?client_id=APP-0ROS9DU5F717F7XN&response_type=code&scope=openid&redirect_uri=https://tiled-demo.nsls2.bnl.gov/auth/code",
175175
```
176176

177177
Navigate to this address in a web browser, log in when prompted, and authorize
178178
Tiled when prompted. You will be redirected to a page at
179-
`https://tiled-demo.blueskyproject.io/auth/code?code=[redacted]` and shown
179+
`https://tiled-demo.nsls2.bnl.gov/auth/code?code=[redacted]` and shown
180180
a valid refresh token from Tiled that encodes your ORCID username. Exchange the
181181
refresh token for an access token and a fresh refresh token like so.
182182

183183
```
184-
$ http POST https://tiled-demo.blueskyproject.io/api/v1/auth/session/refresh refresh_token="TOKEN PASTED FROM WEB BROWSER" > tokens.json
184+
$ http POST https://tiled-demo.nsls2.bnl.gov/api/v1/auth/session/refresh refresh_token="TOKEN PASTED FROM WEB BROWSER" > tokens.json
185185
```
186186

187187
From here, everything follows the same as in Scenario 1, above.

docs/source/reference/http-api-overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ nested under `/api/v1/auth/`.
4444

4545
To view and try the *interactive* docs, visit
4646

47-
[http://tiled-demo.blueskyproject.io/docs](http://tiled-demo.blueskyproject.io/docs)
47+
[http://tiled-demo.nsls2.bnl.gov/docs](http://tiled-demo.nsls2.bnl.gov/docs)
4848

4949
or, to work fully locally, start the Tiled server with the demo
5050
Tree from a Terminal

docs/source/tutorials/login.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
# Log into an Authenticated Tiled Server
33

44
For this tutorial, we will log in to the demo Tiled server at
5-
`https://tiled-demo.blueskyproject.io`. This server is configured to use
5+
`https://tiled-demo.nsls2.bnl.gov`. This server is configured to use
66
[ORCID](https://orcid.org) for authentication, so you will need an ORCID
77
account.
88

99
From Python, connect as usual.
1010

1111
```python
1212
>>> from tiled.client import from_uri
13-
>>> c = from_uri("https://tiled-demo.blueskyproject.io")
13+
>>> c = from_uri("https://tiled-demo.nsls2.bnl.gov")
1414
```
1515

1616
Now, ask to log in.
@@ -62,13 +62,13 @@ Next, quit Python and start it fresh.
6262

6363
```python
6464
>>> from tiled.client import from_uri
65-
>>> c = from_uri("https://tiled-demo.blueskyproject.io")
65+
>>> c = from_uri("https://tiled-demo.nsls2.bnl.gov")
6666
>>> c
6767
<Container {'big_image', 'small_image', 'medium_image', ...} ~13 entries>
6868
```
6969

7070
Notice that you are _not_ prompted to log in again. The login process
71-
stashed a file (under `~/.config/tiled/tokens/tiled-demo.blueskyproject.io/`)
71+
stashed a file (under `~/.config/tiled/tokens/tiled-demo.nsls2.bnl.gov/`)
7272
that enables the session to be reused. It expires if unused for some period. By
7373
default it expires after one week of disuse, but this is configurable and can
7474
vary from one Tiled server to another.

tiled/_tests/test_pickle.py

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,43 +5,52 @@
55

66
import httpx
77
import pytest
8-
from packaging.version import parse
8+
import uvicorn
99

1010
from ..client import from_context
1111
from ..client.cache import Cache
1212
from ..client.context import Context
13+
from ..config import Authentication
14+
from ..server.app import build_app
15+
from ..utils import import_object
16+
from .utils import Server
1317

14-
MIN_VERSION = "0.1.0a104"
15-
API_URL = "https://tiled-demo.blueskyproject.io/api/v1/"
1618

19+
@pytest.fixture(scope="module")
20+
def server_url():
21+
EXAMPLE = "tiled.examples.generated:tree"
22+
tree = import_object(EXAMPLE)
23+
app = build_app(tree, authentication=Authentication(single_user_api_key="secret"))
1724

18-
def test_pickle_context():
25+
config = uvicorn.Config(app, host="127.0.0.1", port=0, log_level="info")
26+
server = Server(config)
27+
with server.run_in_thread() as url:
28+
yield url
29+
30+
31+
def test_pickle_context(server_url):
1932
try:
20-
httpx.get(API_URL).raise_for_status()
33+
httpx.get(server_url).raise_for_status()
2134
except Exception:
22-
raise pytest.skip(f"Could not connect to {API_URL}")
23-
with Context(API_URL) as context:
35+
raise pytest.skip(f"Could not connect to {server_url}")
36+
with Context.from_any_uri(server_url, api_key="secret")[0] as context:
2437
pickle.loads(pickle.dumps(context))
2538

2639

2740
@pytest.mark.parametrize("structure_clients", ["numpy", "dask"])
28-
def test_pickle_clients(structure_clients, tmpdir):
41+
def test_pickle_clients(server_url, structure_clients, tmpdir):
2942
try:
30-
httpx.get(API_URL).raise_for_status()
43+
httpx.get(server_url).raise_for_status()
3144
except Exception:
32-
raise pytest.skip(f"Could not connect to {API_URL}")
45+
raise pytest.skip(f"Could not connect to {server_url}")
3346
cache = Cache(tmpdir / "http_response_cache.db")
34-
with Context(API_URL, cache=cache) as context:
35-
if parse(context.server_info.library_version) < parse(MIN_VERSION):
36-
raise pytest.skip(
37-
f"Server at {API_URL} is running too old a version to test against."
38-
)
47+
with Context.from_any_uri(server_url, api_key="secret", cache=cache)[0] as context:
3948
client = from_context(context, structure_clients)
4049
pickle.loads(pickle.dumps(client))
4150
for segments in [
42-
["generated"],
43-
["generated", "small_image"],
44-
["generated", "short_table"],
51+
[],
52+
["nested", "images", "small_image"],
53+
["tables", "short_table"],
4554
]:
4655
original = client
4756
for segment in segments:

web-frontend/package-lock.json

Lines changed: 0 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)