|
1 |
| -# NSC Docker Godbolt |
| 1 | +# NSC & Godbolt integration |
2 | 2 |
|
3 |
| -## Run NSC tool straight from build directory in compiler explorer docker container! |
| 3 | +## Run Compiler Explorer with NSC tool in docker container! |
4 | 4 |
|
5 |
| -Currently only Windows platform with target *x86_64* architecture is supported. Tested with Hyper-V isolation mode. |
| 5 | +https://github.com/user-attachments/assets/8d409477-92e4-4238-b5e5-637cfbdf7263 |
6 | 6 |
|
7 |
| -### Requirements |
| 7 | +## Requirements |
8 | 8 |
|
9 |
| -- [***Docker Desktop***](https://www.docker.com/products/docker-desktop/) |
| 9 | +- Configured [***Docker***](https://docs.docker.com/desktop/setup/install/windows-install/) for Windows Containers |
| 10 | +- [Windows, Windows Server Core or Windows Server](<https://learn.microsoft.com/en-us/virtualization/windowscontainers/manage-containers/container-base-images>) with **minumum** x86_64 10.0.20348 build (2022 distributions) |
10 | 11 |
|
11 |
| -### How To |
| 12 | +> [!TIP] |
| 13 | +> type `cmd /ver` to see your build version |
12 | 14 |
|
13 |
| -Switch docker to windows containers, configure CMake with `NBL_ENABLE_DOCKER_INTEGRATION` option (recommended Visual Studio generator) & build `run-compiler-explorer` target. After the build completes type `localhost` in your browser. |
| 15 | +> [!CAUTION] |
| 16 | +> Hyper-V is **NOT** supported, you must run NSC Godbolt container as process |
| 17 | +
|
| 18 | +## How to run image |
| 19 | + |
| 20 | +> [!IMPORTANT] |
| 21 | +> If using Docker Desktop - first make sure you have switched to `Containers for Windows`, see image bellow. If you are CLI user and have client & daemon headless then use appropriate windows build context. |
14 | 22 |
|
15 | 23 | 
|
16 | 24 |
|
| 25 | +> [!CAUTION] |
| 26 | +> Examples bellow use `docker compose` to run the image but if you want to `docker run` then make sure to mount required system directories and expose port otherwise will fail, see the compose file for more details |
| 27 | +
|
| 28 | +### from container registry |
| 29 | + |
| 30 | +execute |
| 31 | + |
| 32 | +```powershell |
| 33 | +curl -L https://raw.githubusercontent.com/Devsh-Graphics-Programming/Nabla/master/compose.yml | docker compose -f - up |
| 34 | +``` |
| 35 | + |
| 36 | +or in Nabla checkout |
| 37 | + |
| 38 | +```powershell |
| 39 | +docker compose up |
| 40 | +``` |
| 41 | + |
| 42 | +and type `localhost` in your browser. |
| 43 | + |
| 44 | +### from Nabla pipeline workflow artifacts |
| 45 | + |
| 46 | +> [!NOTE] |
| 47 | +> We publish container images to the GitHub Container Registry that include **only the Release variant** of NSC executables built with **MSVC**. |
| 48 | +> However, our CI pipelines **build and test all configurations**. Compressed images for each configuration are uploaded as **workflow artifacts**. |
| 49 | +> Look for artifacts named: |
| 50 | +> `<prefix>-msvc-<config>-nsc-godbolt-image` |
| 51 | +
|
| 52 | +> [!NOTE] |
| 53 | +> To decompress image artifact you need [zstd](<https://github.com/facebook/zstd/releases>) |
| 54 | +
|
| 55 | +Download workflow image artifact, unzip and |
| 56 | + |
| 57 | +```powershell |
| 58 | +zstd -d < <prefix>-msvc-<config>-nsc-godbolt-image.tar.zst | docker load |
| 59 | +``` |
| 60 | + |
| 61 | +<details> |
| 62 | +<summary>Docker load example (click to expand)</summary> |
| 63 | + |
| 64 | +``` |
| 65 | +C:\Users\anastaziuk\Desktop\DevshGraphicsProgramming\Nabla\tools\nsc\docker>zstd -d < run-windows-17.13.6-msvc-Debug-nsc-godbolt-image.tar.zst | docker load |
| 66 | +b2ebf78c3627: Loading layer [==================================================>] 3.149MB/3.149MB |
| 67 | +4c201e14cc01: Loading layer [==================================================>] 77.4MB/77.4MB |
| 68 | +68a216251b8f: Loading layer [==================================================>] 61.95kB/61.95kB |
| 69 | +7a4e13ca4c4e: Loading layer [==================================================>] 52.74kB/52.74kB |
| 70 | +634001f55b21: Loading layer [==================================================>] 52.74kB/52.74kB |
| 71 | +6a609178bb9a: Loading layer [==================================================>] 52.74kB/52.74kB |
| 72 | +3d7afb042308: Loading layer [==================================================>] 52.74kB/52.74kB |
| 73 | +ca034d7bc58a: Loading layer [==================================================>] 52.74kB/52.74kB |
| 74 | +55b4134a1ae9: Loading layer [==================================================>] 52.74kB/52.74kB |
| 75 | +0648adff3faa: Loading layer [==================================================>] 52.74kB/52.74kB |
| 76 | +Loaded image: ghcr.io/devsh-graphics-programming/nabla:nsc-godbolt-build-msvc-debug-17.13.6 |
| 77 | +``` |
| 78 | + |
| 79 | +</details> |
| 80 | + |
| 81 | +copy `compose.yml` in Nabla root directory to eg. `override-compose.yml`, replace it's `image` field value with loaded image name (eg. `ghcr.io/devsh-graphics-programming/nabla:nsc-godbolt-build-msvc-debug-17.13.6` like in the example) and execute |
| 82 | + |
| 83 | +``` |
| 84 | +docker compose -f override-compose.yml up |
| 85 | +``` |
| 86 | + |
| 87 | +## How to build image |
| 88 | + |
| 89 | +Configure CMake with `NBL_ENABLE_DOCKER_INTEGRATION` and build `run-compiler-explorer` target. |
0 commit comments