Skip to content

Latest commit

 

History

History

README.md

Build

This project generates a static website from the STACKIT price list. Ready to tweak and test this webapp locally? Follow these instructions.

Requirements

Debian/Ubuntu
sudo apt update
sudo apt install \
	curl \
	libdbd-sqlite3-perl \
	libjson-xs-perl \
	libplack-perl \
	libtemplate-perl \
	libtext-csv-perl \
	sqlite3
macOS
brew install cpanminus curl perl pkg-config sqlite3
cpanm --installdeps .

One-shot build

The whole pipeline (download, import, export, generate) is wrapped in build.sh:

cd build
bash build.sh

Skip the download and reuse the existing pricing.json:

SKIP_DOWNLOAD=1 bash build.sh

Step by step

1. Download the price list

curl "https://pim.api.stackit.cloud/v1/skus" -o pricing.json

2. Create the database

sqlite3 stackit.db < create.sql

3. Seed regions

sqlite3 stackit.db < regions.sql

4. Import pricing

perl import.pl < pricing.json

This fills two tables:

  • instance-types — one row per flavor (e.g. c1.1), region independent facts
  • instance-prices — one row per flavor + region + availability (Single/Multi-AZ)
  • block-storage — one row per storage class + region + availability (capacity/backup billed per GB, performance classes billed per disk)

5. Add extra instance type information (optional, curated)

The STACKIT API does not expose exact CPU architecture, CPU/GPU model, etc. Add them via SQL in instance-types-extra.sql and apply:

sqlite3 stackit.db < instance-types-extra.sql

Example — add a CPU model and base clock for a whole family:

UPDATE "instance-types"
  SET "cpuModel" = 'Intel Xeon Sapphire Rapids', "cpuBaseClockGhz" = 2.0
  WHERE "instanceFamily" = 'c3i';

Example — add a GPU model:

UPDATE "instance-types"
  SET "gpuModel" = 'NVIDIA H100', "gpuMemoryGb" = 80
  WHERE "instanceType" = 'n3.14d.g1';

6. Export CSV + SQL

bash export.sh

7. Generate the website

perl web.pl

Preview locally

plackup --host "127.0.0.1" --port "8080"

Then open http://127.0.0.1:8080/.

Data model notes

STACKIT flavor naming (best effort):

<type><gen>[vendor].<size>[d][.g<gpus>]
  type:   b/t=basic/tiny, c=compute, g=general, m=memory, s=storage, n=gpu, u=ultra-memory
  vendor: i=Intel, a=AMD, r=ARM (absent on older generations)
  d:      flavor ships with local NVMe disk
  .gN:    number of GPUs (GPU servers only)

Regions ending with -m (metro) are Multi-AZ. In the database this is stored as the metro flag on each price row, so the base region code (eu01, eu02) stays clean.