Skip to content

Commit bbe52ca

Browse files
author
Benoit de Chateauvieux
committed
Pass TILES_BACKEND_URL and CLOUDFRONT_URL as Environment Variables
1 parent f6dd632 commit bbe52ca

File tree

5 files changed

+7
-5
lines changed

5 files changed

+7
-5
lines changed

ui/geofm-demo-stack/lib/solara-fe-stack.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,9 @@ export class SolaraFEStack extends cdk.NestedStack {
131131
environment: {
132132
'SOLARA_APP': 'app:app',
133133
'SOLARA_ASSETS_PREFIX': '/solara/',
134-
"GEOTIFF_BUCKET_URL": props.geoTiffBucket.urlForObject()
134+
"GEOTIFF_BUCKET_URL": props.geoTiffBucket.urlForObject(),
135+
"TILES_BACKEND_URL": "/tile/cog/tiles",
136+
"CLOUDFRONT_URL": "/",
135137
}
136138
});
137139

ui/geofm-demo-stack/solara-fe/imagery_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def convert_sentinel_id(sentinel_id):
164164
if not config.use_remote_s2_cogs:
165165
geotiff_url = f"{geotiff_url}&{viz_params}"
166166

167-
return f"{config.tiles_backend_url}/{{z}}/{{x}}/{{y}}.png?url={geotiff_url}"
167+
return f"{os.environ.get('TILES_BACKEND_URL')}/{{z}}/{{x}}/{{y}}.png?url={geotiff_url}"
168168

169169
except Exception as e:
170170
logger.error(f"Error generating layer URL: {str(e)}")

ui/geofm-demo-stack/solara-fe/pages/01-home.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def LandingPage():
4949

5050
#FOR DEPLOYMENT
5151
demo_config = load_config()
52-
cloudfront_url = demo_config["config"]["cloudfront_url"]
52+
cloudfront_url = os.environ.get('CLOUDFRONT_URL')
5353
background_video_url = f"{cloudfront_url}/{demo_config['config']['background_video_file']}"
5454

5555
with solara.Column(style={"height": "100vh", "width": "100vw", "position": "relative", "overflow": "hidden"}):

ui/geofm-demo-stack/solara-fe/pages/02-run_similarity_search.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def create_base_layers(self):
7777
max_zoom=24,
7878
name='Sentinel-2',
7979
bounds=self.aoi_bounds,
80-
url=f"{self.config.tiles_backend_url}/{{z}}/{{x}}/{{y}}.png?url={self.config.sentinel2_cog_source_url}"
80+
url=f"{os.environ.get('TILES_BACKEND_URL')}/{{z}}/{{x}}/{{y}}.png?url={self.config.sentinel2_cog_source_url}"
8181
)
8282

8383
chip_grid = self._create_chip_grid()

ui/geofm-demo-stack/solara-fe/pages/03-detect_change.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def create_base_layers(self):
122122
max_zoom=24,
123123
name='Sentinel-2',
124124
bounds=self.aoi_bounds,
125-
url=f"{self.config.tiles_backend_url}/{{z}}/{{x}}/{{y}}.png?url={self.config.sentinel2_cog_source_url}"
125+
url=f"{os.environ.get('TILES_BACKEND_URL')}/{{z}}/{{x}}/{{y}}.png?url={self.config.sentinel2_cog_source_url}"
126126
)
127127

128128
chip_grid = self._create_chip_grid()

0 commit comments

Comments
 (0)