Skip to content

Commit dbebedb

Browse files
committed
Add Scaleway-instance template for scaleway compute instances
1 parent e7d705b commit dbebedb

File tree

8 files changed

+930
-0
lines changed

8 files changed

+930
-0
lines changed

.icons/scaleway.svg

Lines changed: 1 addition & 0 deletions
Loading
20.6 KB
Loading

registry/mossylion/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
display_name: "Mossy Lion"
3+
bio: "Tinkerer, exploring European cloud providers"
4+
avatar: "./.images/avatar.png"
5+
github: "mossylion"
6+
status: "community"
7+
---
8+
9+
# Mossy Lion
10+
11+
Exploring European cloud providers. Usually find me outdoors but if not, somewhere deep in Kubernetes and infra
12+
13+
## Templates
14+
15+
- **scaleway-instance**: Scaleway workspace instance with persistent home directory
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
---
2+
display_name: "Scaleway Instance"
3+
description: "A workspace spun up on a Scaleway Instance"
4+
icon: "../../../../.icons/scaleway.svg"
5+
verified: false
6+
tags: ["scaleway", "dev", "tools"]
7+
---
8+
9+
# Scaleway Instance Template
10+
11+
This template provisions Coder workspaces on [Scaleway](https://www.scaleway.com/) cloud instances with full customization options for regions, instance types, operating systems, and storage configurations.
12+
13+
## Features
14+
15+
- **Multi-region support**: Choose from France (Paris), Netherlands (Amsterdam), or Poland (Warsaw)
16+
- **Flexible instance sizing**: Wide range of instance types from development to high-performance computing
17+
- **Multiple OS options**: Debian 12/13, Ubuntu 24.04, and Fedora 41
18+
- **Customizable storage**: Adjustable disk size with configurable IOPS
19+
- **IPv4 and IPv6 networking**: Dual-stack IP configuration for enhanced connectivity
20+
21+
## Prerequisites
22+
23+
### Scaleway Account Setup
24+
25+
1. Create a [Scaleway account](https://console.scaleway.com/)
26+
2. Create a new project or use an existing one
27+
3. Generate API credentials:
28+
- Go to **IAM** > **API Keys** in the Scaleway Console
29+
- Create a new API key
30+
- Note down the **Access Key** and **Secret Key**
31+
- Copy your **Project ID** from the project settings
32+
- Give permissions for **BlockStorageFullAccess**, **ProjectReadOnly**, **InstancesFullAccess** as a starting point
33+
34+
## Architecture
35+
36+
This template creates the following resources for each workspace:
37+
38+
### Persistent Resources
39+
40+
- **Block Volume**: Mounted as user's home directory (preserves all data, configs, and projects)
41+
42+
### Ephemeral Resources (destroyed when workspace stops)
43+
44+
- **Scaleway Instance**: Virtual machine created fresh on each workspace start
45+
- **IPv4 Address**: Routed IPv4 address assigned dynamically
46+
- **IPv6 Address**: Routed IPv6 address assigned dynamically
47+
- **Cloud-init Configuration**: Automated setup of the Coder agent and persistent storage mounting
48+
49+
## Configuration Options
50+
51+
### Region Selection
52+
53+
Choose from three available regions:
54+
55+
- **France - Paris (fr-par)**: Default, lowest latency for European users
56+
- **Netherlands - Amsterdam (nl-ams)**: Alternative European location
57+
- **Poland - Warsaw (pl-waw)**: Eastern European option
58+
59+
### Instance Types
60+
61+
The template supports a comprehensive range of Scaleway instance types:
62+
63+
#### Development Instances
64+
65+
- **STARDUST1-S**: 1 CPU, 1GB RAM - Basic development
66+
- **DEV1-S/M/L/XL**: 2-4 CPUs, 2-12GB RAM - Standard development
67+
68+
#### Production Instances
69+
70+
- **ENT1 Series**: 2-96 CPUs, 8-384GB RAM - Enterprise workloads
71+
- **GP1 Series**: 4-48 CPUs, 16-256GB RAM - General purpose
72+
- **PRO2 Series**: 2-32 CPUs, 8-128GB RAM - Professional workloads
73+
74+
#### Specialized Instances
75+
76+
- **L4 Series**: GPU-enabled instances for AI/ML workloads
77+
- **COPARM1 Series**: ARM64 architecture for specific use cases
78+
79+
### Operating System Options
80+
81+
- **Debian 13 (Trixie)**: Latest Debian release
82+
- **Debian 12 (Bookworm)**: Stable Debian LTS
83+
- **Ubuntu 24.04 (Noble)**: Latest Ubuntu LTS
84+
- **Fedora 41**: Cutting-edge features and packages
85+
86+
### Storage Configuration
87+
88+
- **Home Directory Size**: 10-500GB adjustable via slider (your entire home directory)
89+
- **IOPS**: 5,000 or 15,000 IOPS options for performance tuning
90+
91+
## Template Components
92+
93+
### Included Tools
94+
95+
- **VS Code Server**: Browser-based IDE with full extension support
96+
- **System Monitoring**: CPU, RAM, and disk usage metrics
97+
- **Dotfiles Support**: Automatic dotfiles synchronization on workspace start
98+
- **Custom Environment Variables**: Pre-configured welcome message
99+
100+
### Cloud-init Setup
101+
102+
The template uses cloud-init for:
103+
104+
- Automatic Coder agent installation and configuration
105+
- User account setup with proper permissions
106+
- Persistent home directory mounting (automatic disk partitioning and filesystem creation)
107+
- Development tools initialization
108+
109+
## Usage
110+
111+
### Creating a Workspace
112+
113+
1. **Select Template**: Choose "Scaleway Instance" from your Coder templates
114+
2. **Configure Region**: Pick your preferred Scaleway region
115+
3. **Choose Instance**: Select instance type based on your performance needs
116+
4. **Select OS**: Pick your preferred operating system
117+
5. **Set Home Directory Size**: Adjust storage size (10-500GB) for your persistent home directory
118+
6. **Create**: Launch your workspace
119+
120+
### Managing Costs
121+
122+
- **VM instances are destroyed** when workspace stops (zero compute costs when not in use)
123+
- **IP addresses are released** when workspace stops (no static IP charges)
124+
- **Home directory persists** on dedicated block volume (small storage cost only)
125+
- **Fresh OS** on each workspace start with persistent user data
126+
- Choose appropriate instance sizes for your workload requirements
127+
128+
## Customization
129+
130+
### Extending the Template
131+
132+
You can customize this template by:
133+
134+
1. **Adding Software**: Modify cloud-init scripts to install additional tools
135+
2. **Custom Modules**: Include additional Coder modules from the registry
136+
3. **Network Configuration**: Adjust security groups or network settings
137+
4. **Startup Scripts**: Add custom initialization logic
138+
139+
## Maintenance
140+
141+
### Updating Instance Types
142+
143+
To update the available instance types, regenerate the `scaleway-config.json` file:
144+
145+
```bash
146+
scw instance server-type list -o json | jq 'map({name, cpu, gpu, ram, arch})' > scaleway-config.json.json
147+
```
148+
149+
This pulls the latest instance types from Scaleway and formats them for use in the template.
150+
151+
## References
152+
153+
- [Scaleway Documentation](https://www.scaleway.com/en/docs/)
154+
- [Scaleway Instance Types](https://www.scaleway.com/en/pricing/#instances)
155+
- [Coder Templates Documentation](https://coder.com/docs/templates)
156+
- [Terraform Scaleway Provider](https://registry.terraform.io/providers/scaleway/scaleway/latest/docs)
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#cloud-config
2+
cloud_final_modules:
3+
- [scripts-user, always]
4+
hostname: ${hostname}
5+
users:
6+
- name: ${linux_user}
7+
sudo: ALL=(ALL) NOPASSWD:ALL
8+
shell: /bin/bash
9+
10+
# Setup persistent storage disk
11+
disk_setup:
12+
/dev/sdb:
13+
table_type: gpt
14+
layout: true
15+
overwrite: false
16+
17+
fs_setup:
18+
- label: persistent-home
19+
filesystem: ext4
20+
device: /dev/sdb1
21+
partition: auto
22+
23+
mounts:
24+
- ["/dev/sdb1", "/home/${linux_user}", "ext4", "defaults", "0", "2"]
25+
26+
# Fix ownership after mounting
27+
runcmd:
28+
- chown -R ${linux_user}:${linux_user} /home/${linux_user}
29+
- chmod 755 /home/${linux_user}
30+
31+
# Automatically grow the partition
32+
growpart:
33+
mode: auto
34+
devices: ['/']
35+
ignore_growroot_disabled: false
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
sudo -u '${linux_user}' CODER_AGENT_TOKEN=${coder_agent_token} sh -c '${init_script}'

0 commit comments

Comments
 (0)