Skip to content

Commit 865e33f

Browse files
committed
CI: deploy ArtistIC map to GitHub pages
1 parent 7fc711b commit 865e33f

File tree

3 files changed

+233
-1
lines changed

3 files changed

+233
-1
lines changed

.github/config/croc_map_ci.json

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
{
2+
"general" : {
3+
"chip" : "croc"
4+
},
5+
"gds" : {
6+
"file" : "/fosic/designs/croc/artistic/meerkat_work/croc_chip.gds.gz",
7+
"x_offset_um" : -144,
8+
"y_offset_um" : -144,
9+
"width_um" : 2048,
10+
"height_um" : 2048
11+
},
12+
"image": {
13+
"px_width" : 20480,
14+
"px_height" : 20480,
15+
"overrender_factor" : 1,
16+
"num_segs_width" : 5,
17+
"num_segs_height" : 5
18+
},
19+
"paper": {
20+
"width_cm" : 84.1,
21+
"height_cm" : "-"
22+
},
23+
"colors" : {
24+
"CONT" : {"layer" : "6/0", "color" : "#0000CD", "alpha" : "0.8" },
25+
"M1" : {"layer" : "8/0", "color" : "#0000CD", "alpha" : "0.8" },
26+
"V1" : {"layer" : "19/0", "color" : "#7CCD7C", "alpha" : "0.7" },
27+
"M2" : {"layer" : "10/0", "color" : "#7CCD7C", "alpha" : "0.7" },
28+
"V2" : {"layer" : "29/0", "color" : "#5c0c02", "alpha" : "0.6" },
29+
"M3" : {"layer" : "30/0", "color" : "#5c0c02", "alpha" : "0.6" },
30+
"V3" : {"layer" : "49/0", "color" : "#CD3700", "alpha" : "0.5" },
31+
"M4" : {"layer" : "50/0", "color" : "#CD3700", "alpha" : "0.5" },
32+
"V4" : {"layer" : "66/0", "color" : "#00CD00", "alpha" : "0.5" },
33+
"M5" : {"layer" : "67/0", "color" : "#00CD00", "alpha" : "0.5" },
34+
"TV1" : {"layer" : "125/0", "color" : "#7FFFD4", "alpha" : "0.5" },
35+
"T1" : {"layer" : "126/0", "color" : "#7FFFD4", "alpha" : "0.5" },
36+
"TV2" : {"layer" : "133/0", "color" : "#1E90FF", "alpha" : "0.5" },
37+
"T2" : {"layer" : "134/0", "color" : "#FFFFFF", "alpha" : "0.8" }
38+
},
39+
"work" : {
40+
"dir" : "/fosic/designs/croc/artistic/renderics"
41+
},
42+
"map" : {
43+
"output" : "/fosic/designs/croc/artistic/mapify",
44+
"layers" : [
45+
"#RENDER#",
46+
"M1",
47+
"M2",
48+
"M3",
49+
"M4",
50+
"M5",
51+
"T1",
52+
"T2"
53+
],
54+
"openmaps_tile_size_px" : 512,
55+
"tmp" : "/fosic/designs/croc/artistic/mapify_tmp"
56+
},
57+
"tech" : {
58+
"manifest_version" : 1,
59+
"max_px_tile" : 2500000000,
60+
"pdk" : "ihp13",
61+
"layer_order" : [
62+
"CONT",
63+
"M1",
64+
"V1",
65+
"M2",
66+
"V2",
67+
"M3",
68+
"V3",
69+
"M4",
70+
"V4",
71+
"M5",
72+
"TV1",
73+
"T1",
74+
"TV2",
75+
"T2"
76+
],
77+
"db_unit_nm" : 0.1,
78+
"dry_run" : false
79+
}
80+
}
81+

.github/config/gh-pages-map.html

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>OpenCrocMap</title>
6+
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.6.0/dist/leaflet.css" integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ==" crossorigin="" />
7+
<style type="text/css">
8+
body{
9+
margin: 0;
10+
padding: 0;
11+
}
12+
#map {
13+
width: 100vw;
14+
height: 100vh;
15+
}
16+
#layer-select {
17+
position: absolute;
18+
top: 10px;
19+
left: 50px;
20+
z-index: 1000;
21+
padding: 5px;
22+
background: white;
23+
border: 1px solid #ccc;
24+
border-radius: 5px;
25+
}
26+
</style>
27+
</head>
28+
<body>
29+
<div id="map"></div>
30+
<select id="layer-select">
31+
<option value="Render">Render</option>
32+
<option value="M1">Metal 1</option>
33+
<option value="M2">Metal 2</option>
34+
<option value="M3">Metal 3</option>
35+
<option value="M4">Metal 4</option>
36+
<option value="M5">Metal 5</option>
37+
<option value="T1">Top Metal 1</option>
38+
<option value="T2">Top Metal 2</option>
39+
</select>
40+
41+
<script src="https://unpkg.com/leaflet@1.6.0/dist/leaflet.js" integrity="sha512-gZwIG9x3wUXg2hdXF6+rVkLF/0Vi9U8D2Ntg4Ga5I5BZpVkVxlJWbSQtXPSiUTtC0TjtGOmxa1AJPuV0CPthew==" crossorigin=""></script>
42+
<script>
43+
// All the code for the leaflet map will come here
44+
const map = L.map('map', {
45+
center: [40, -70],
46+
zoom: 2,
47+
minzoom: 0,
48+
maxZoom: 6
49+
});
50+
51+
// Define the layers
52+
const M1Map = L.tileLayer('M1/{z}/{x}/{y}.png', {
53+
attribution: 'M1'
54+
});
55+
56+
const M2Map = L.tileLayer('M2/{z}/{x}/{y}.png', {
57+
attribution: 'M2'
58+
});
59+
60+
const M3Map = L.tileLayer('M3/{z}/{x}/{y}.png', {
61+
attribution: 'M3'
62+
});
63+
64+
const M4Map = L.tileLayer('M4/{z}/{x}/{y}.png', {
65+
attribution: 'M4'
66+
});
67+
68+
const M5Map = L.tileLayer('M5/{z}/{x}/{y}.png', {
69+
attribution: 'M5'
70+
});
71+
72+
const T1Map = L.tileLayer('T1/{z}/{x}/{y}.png', {
73+
attribution: 'T1'
74+
});
75+
76+
const T2Map = L.tileLayer('T2/{z}/{x}/{y}.png', {
77+
attribution: 'T2'
78+
});
79+
80+
const RenderMap = L.tileLayer('render/{z}/{x}/{y}.png', {
81+
attribution: 'Render'
82+
});
83+
84+
// Add the default layer to the map
85+
RenderMap.addTo(map);
86+
87+
// Store layers in an object for easy access
88+
const layers = {
89+
T2: T2Map,
90+
T1: T1Map,
91+
M5: M5Map,
92+
M4: M4Map,
93+
M3: M3Map,
94+
M2: M2Map,
95+
M1: M1Map,
96+
Render: RenderMap
97+
};
98+
99+
// Handle layer selection
100+
const layerSelect = document.getElementById('layer-select');
101+
layerSelect.addEventListener('change', (e) => {
102+
const selectedLayer = layers[e.target.value];
103+
map.eachLayer((layer) => {
104+
map.removeLayer(layer);
105+
});
106+
selectedLayer.addTo(map);
107+
});
108+
109+
</script>
110+
</body>
111+
</html>

.github/workflows/full-flow.yml

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ jobs:
2020
backend:
2121
runs-on: ubuntu-latest
2222
timeout-minutes: 180
23+
permissions:
24+
pages: write
25+
id-token: write
26+
environment:
27+
name: github-pages
28+
url: ${{ steps.deployment.outputs.page_url }}
2329
steps:
2430
- name: Checkout repository (with submodules)
2531
uses: actions/checkout@v4
@@ -54,6 +60,7 @@ jobs:
5460
uses: actions/checkout@v4
5561
with:
5662
repository: pulp-platform/artistic
63+
ref: 7e142409d7ba6a51cabd5658fcceb85d49213153
5764
path: artistic
5865
- name: Update package lists and install Inkscape, img2pdf
5966
run: |
@@ -127,7 +134,9 @@ jobs:
127134
run: |
128135
mkdir -p artistic/renderics
129136
cp -v .github/config/croc_ci.json artistic/renderics/croc_ci.json
137+
cp -v .github/config/croc_map_ci.json artistic/renderics/croc_map_ci.json
130138
sed "s|/fosic/designs|/home/runner/work/croc|g" artistic/renderics/croc_ci.json > artistic/renderics/croc_ci_runner.json
139+
sed "s|/fosic/designs|/home/runner/work/croc|g" artistic/renderics/croc_map_ci.json > artistic/renderics/croc_map_ci_runner.json
131140
- name: Analyze render
132141
uses: ./.github/actions/oseda-cmd
133142
with:
@@ -148,7 +157,7 @@ jobs:
148157
uses: ./.github/actions/oseda-cmd
149158
with:
150159
cmd: "cd artistic; make gen_raw CFG_FILE=/fosic/designs/croc/artistic/renderics/croc_ci.json"
151-
- name: Render
160+
- name: Render PDFs
152161
run: |
153162
cd artistic; make gen_pdfs CFG_FILE=renderics/croc_ci_runner.json
154163
- name: Finish render
@@ -174,3 +183,34 @@ jobs:
174183
name: render-jpg
175184
path: artistic/renderics/croc_render.jpg
176185
continue-on-error: true
186+
# Map render and deploy below:
187+
- name: Render b/w map layer tiles
188+
uses: ./.github/actions/oseda-cmd
189+
with:
190+
cmd: "cd artistic; make gen_raw CFG_FILE=/fosic/designs/croc/artistic/renderics/croc_map_ci.json"
191+
- name: Render Map Tiles
192+
run: |
193+
cd artistic; make gen_tiles CFG_FILE=renderics/croc_map_ci_runner.json
194+
- name: Mapify Tiles
195+
run: |
196+
cd artistic; python3 scripts/mapify.py renderics/croc_map_ci_runner.json | sh
197+
- name: Copy index.html
198+
run: |
199+
cp .github/config/gh-pages-map.html artistic/mapify/index.html
200+
- name: Upload OpenStreetMap DB
201+
uses: actions/upload-artifact@v4
202+
with:
203+
name: map-db
204+
path: artistic/mapify
205+
continue-on-error: true
206+
- name: Copy GDS to be deployed
207+
run: |
208+
cp artistic/meerkat_work/croc_logo.gds artistic/mapify/croc_logo.gds
209+
- name: Upload OpenStreetMap DB to pages
210+
uses: actions/upload-pages-artifact@v3
211+
with:
212+
path: artistic/mapify
213+
- name: Deploy pages (on main only)
214+
if: github.ref == 'refs/heads/main'
215+
id: deployment
216+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)