☁️ PuffCloud Computing 101

Setup · Your cloud on your laptop

Floci, locally or in a Codespace

🎯 What you get

🧭 Pick your way in

Way A, your laptop (recommended if Docker works on it)

  1. Install Docker Desktop (Mac, Windows) or Docker Engine (Linux, your user in the docker group). Rootless Docker is not supported.
  2. Install the AWS CLI v2 and git.
  3. On Windows: use PowerShell for everything, with Git for Windows and the AWS CLI .msi installer. The course gives you a PowerShell version of every command and every script (env.ps1, doctor.ps1, check.ps1...), look for the 🪟 Windows tab.
  4. On a Mac, paste this first, so your terminal accepts commands with comments: setopt interactive_comments sh_word_split. After that, source env.sh does it for you.
  5. Get the starter (next section), then in its folder:
# Start Floci (the first time pulls about 100 MB)
docker compose up -d

# Point the AWS CLI at Floci, in every new terminal
source env.sh

# Check your setup, everything should say OK
./doctor.sh
# Allow the starter's scripts to run (once per machine)
Set-ExecutionPolicy -Scope CurrentUser RemoteSigned -Force

# Start Floci (the first time pulls about 100 MB)
docker compose up -d

# Point the AWS CLI at Floci, in every new PowerShell window
. .\env.ps1

# Check your setup, everything should say OK
.\doctor.ps1

Way B, a GitHub Codespace (a Linux machine in your browser, free with your GitHub account)

  1. Open your group repo on GitHub → Code → Codespaces → Create codespace on main.
  2. Wait for VS Code to open. Floci starts by itself, Docker can take a minute after the codespace wakes up.
  3. In the terminal: source env.sh && ./doctor.sh.
  4. Stop the codespace when you leave (it auto-stops after 30 min idle). The free plan gives about 60 hours a month on 2 cores, plenty for this course.

📦 Get the starter into your group repo

One member does this once, then the others clone the group repo.

# Get the course repo, it holds the starter
git clone https://github.com/ricoleabricot/puff.git /tmp/puff

# Copy the starter into a new folder for your group
mkdir my-group
cp -r /tmp/puff/starter/. my-group/
cd my-group

# Make it a Git repo
git init -b main
git add .
git commit -m "Puff starter"

# Create an empty repo on GitHub (private is fine), then push to it
git remote add origin https://github.com/<you>/<repo>.git
git push -u origin main
# Get the course repo, it holds the starter
git clone https://github.com/ricoleabricot/puff.git $env:TEMP\puff

# Copy the starter into a new folder for your group
New-Item -ItemType Directory my-group | Out-Null
Copy-Item -Recurse -Force $env:TEMP\puff\starter\* my-group\
Copy-Item -Force $env:TEMP\puff\starter\.gitignore my-group\
Copy-Item -Recurse -Force $env:TEMP\puff\starter\.devcontainer my-group\
Set-Location my-group

# Make it a Git repo
git init -b main
git add .
git commit -m "Puff starter"

# Create an empty repo on GitHub (private is fine), then push to it
git remote add origin https://github.com/<you>/<repo>.git
git push -u origin main

Then everyone sets the group id once per terminal, it prefixes every resource name:

# Your group number, two digits
export GROUP=g07
# Your group number, two digits
$env:GROUP = "g07"

🗂️ What's in the starter

FileWhat it's for
docker-compose.ymlFloci 2.5.0 with IAM and security group enforcement, don't change it
env.shsource env.sh in every new terminal
doctor.shchecks your setup
infra/deploy.shyour group's infra, every command in order, so anyone can rebuild it
checks/check.shmilestone checks, ./checks/check.sh M1
NOTES.mdyour decisions with one line of why, it becomes your pitch
wipe.shdeletes all your local AWS resources, keeps your code

🧪 Your first commands

# Who am I? Account 000000000000, that's Floci
aws sts get-caller-identity

# How many regions does this "AWS" have?
aws ec2 describe-regions --query 'length(Regions)'

# A first bucket, then list your buckets
aws s3api create-bucket --bucket $GROUP-hello
aws s3 ls
# Who am I? Account 000000000000, that's Floci
aws sts get-caller-identity

# How many regions does this "AWS" have?
aws ec2 describe-regions --query 'length(Regions)'

# A first bucket, then list your buckets
aws s3api create-bucket --bucket "$env:GROUP-hello"
aws s3 ls

👀 The Floci UI

After the commands, the milestones ask you to go look at what you built.
You get a hint first. Try it, then unfold 📸 to compare with the screenshot.

  1. Open the Floci UI launcher once each time you start Floci. It starts the UI and sends you to port 4500.
  2. After that, the link under each screenshot opens the same screen in your Floci.

It's a resource explorer, not the AWS console, so some steps have a 🆚 toggle with the real one. Look with the UI, build with commands: what you click isn't in your repo, so a rebuild loses it.

🔒 Close Floci to the network

Fix 1: go to your group folder, the one you run docker compose up -d from (change the path), with Docker running. The second command must find both (Windows: True twice). If it doesn't, you're in the wrong folder: stop and find the right one.

cd path/to/my-group
ls -d docker-compose.yml data
cd path\to\my-group
Test-Path docker-compose.yml, data

Fix 2: take the fixed file and restart. It downloads the file, removes the old UI container ("No such container" is fine) and restarts Floci on the same data.

curl -fsSL https://raw.githubusercontent.com/ricoleabricot/puff/main/starter/docker-compose.yml -o docker-compose.yml
docker rm -f floci-aws-ui
docker compose up -d
curl.exe -fsSL https://raw.githubusercontent.com/ricoleabricot/puff/main/starter/docker-compose.yml -o docker-compose.yml
docker rm -f floci-aws-ui
docker compose up -d

Fix 3: check. Wait 20 seconds, then paste the whole block. It lists any Floci port other machines can reach, you want CLOSED.

RUNNING=$(docker ps --format '{{.Names}} {{.Ports}}' | grep floci)
OPEN=$(echo "$RUNNING" | grep -E '0\.0\.0\.0:|\[::\]:')
if [ -z "$RUNNING" ]; then echo "NOT RUNNING: go back to fix 2"
elif [ -n "$OPEN" ]; then echo "STILL OPEN:"; echo "$OPEN"
else echo "CLOSED"; fi
$RUNNING = @(docker ps --format '{{.Names}} {{.Ports}}' | Select-String 'floci')
$OPEN = @($RUNNING | Select-String '0\.0\.0\.0:|\[::\]:')
if ($RUNNING.Count -eq 0) { "NOT RUNNING: go back to fix 2" }
elseif ($OPEN.Count -gt 0) { "STILL OPEN:"; $OPEN | ForEach-Object { "$_" } }
else { "CLOSED" }

Fix 4: only if a VM is still open. It removes the course 2 VMs and nothing else: your app, database and data aren't touched.

for c in $(docker ps -aq --filter name='floci-aws-(ec2|ec2-fwd|sg)-i-'); do docker rm -f "$c"; done
docker ps -aq --filter 'name=floci-aws-(ec2|ec2-fwd|sg)-i-' | ForEach-Object { docker rm -f $_ }

Then run fix 3 again, you want CLOSED.

Fix 5: one member only pushes the fixed file, so nobody gets the old one back from your repo.

git add docker-compose.yml
git commit -m "Close Floci to the network" -- docker-compose.yml
git push
git add docker-compose.yml
git commit -m "Close Floci to the network" -- docker-compose.yml
git push

The other members still do fixes 1 to 4 on their laptop, then take the pushed file:

git checkout -- docker-compose.yml
git pull
docker compose up -d
git checkout -- docker-compose.yml
git pull
docker compose up -d
🧯 Linux, Codespaces, or something looks strange
  • Linux: docker version --format '{{.Server.Version}}' must be 28 or more. Older Docker Engines let machines on the same network reach 127.0.0.1 ports, so update it.
  • Codespace: it isn't on the room's Wi-Fi, but do the fix too so your repo has the right file, and keep every forwarded port Private.
  • A container or an image in docker ps -a that you don't recognize: quit Docker, don't delete it, show it to me.

🔍 Floci vs real AWS, what to keep in mind

TopicOn FlociOn real AWS
Account, credentialsAccount 000000000000, keys test/test are the adminYour org's accounts, SSO, never long-lived admin keys
Container imagesPush to localhost:5100/<repo>, it shows up in ECRPush to <account>.dkr.ecr.<region>.amazonaws.com/<repo>
NetworkSecurity groups filter traffic between containers. Routes, NAT and internet gateways exist in the API but don't route anythingEverything routes for real
Load balancerLives inside Floci, answers on http://<alb-dns>/ (port 80 of your machine)Its own managed nodes in your subnets
ScalingNothing scales on its own. You'll build your own autoscaler with an alarm and a LambdaTarget tracking, scheduled actions
EmailNot delivered, use an SQS queue as your pagerSNS emails, Slack, PagerDuty
CostFreeEvery hour counts, you'll price your stack in course 6

🧯 If it doesn't work

Then course 1, project M0