The Component Workshop Meet the building blocks03 / 04

SECTION 01 · 15 MIN READ & EXPLORE

Component reference

Try every component available in course MDX and copy the example to use in your own chapter.

DEMONSTRATION CONTENT

Each example is followed by its source MDX. Paste it into a chapter without importing the component. Keep the blank lines around Markdown inside component tags.

Prompt

Add a question learners can copy and discuss.

<Prompt
  title="Explain a pipeline"
  instruction="Try explaining it yourself first."
  text="Ask me how a commit moves through a build and a test, one question at a time."
/>

Resource

Link to an article or video and give readers a reason to open it.

READ

GitLab CI/CD pipelines (opens in a new tab)

Look for the difference between a stage and a job.

<Resource
  title="GitLab CI/CD pipelines"
  href="https://docs.gitlab.com/ci/pipelines/"
  note="Look for the difference between a stage and a job."
  preview={false}
/>

Books

Recommend a book with a reading focus.

BOOK

The Phoenix Project (opens in a new tab)

Gene Kim, Kevin Behr, and George Spafford

Look for what limits the team's ability to deliver.

<Books label="Further reading" items={[
  {
    title: "The Phoenix Project",
    href: "https://openlibrary.org/isbn/9781942788294",
    author: "Gene Kim, Kevin Behr, and George Spafford",
    cover: "/covers/devops/phoenix-project.jpg",
    note: "Look for what limits the team's ability to deliver."
  }
]} />

Slides and Slide

Put one concept on each slide.

From change to feedback

Build

Package the change into a repeatable artifact.

Test

Run checks and use their results to decide whether to ship.

<Slides title="From change to feedback">
<Slide title="Build">

Package the change into a repeatable artifact.

</Slide>
<Slide title="Test">

Run checks and use their results to decide whether to ship.

</Slide>
</Slides>

Board

Embed an editable Excalidraw scene with an optional preview.

EXPLORE THE DIAGRAM

Trace a deployment

Experiment freely. Changes disappear when you reset or refresh.

Preview of Trace a deployment

<Board
  title="Trace a deployment"
  src="/boards/deployment.excalidraw"
  preview="/boards/deployment.svg"
/>

Callout

Put a prerequisite, warning, or note beside the relevant instruction.

<Callout kind="prerequisite" title="Check your tools">

Run `docker compose version` before starting the lab.

</Callout>

Reveal

Let learners choose when to read a hint or solution.

Why check the logs?

The logs report what the service did during startup.

<Reveal title="Why check the logs?" kind="explanation">

The logs report what the service did during startup.

</Reveal>

Checkpoint

Ask for a prediction and offer an explanation after the learner has considered it.

CHECK YOUR UNDERSTANDING

Predict the outcome

What happens when a required pipeline test fails?

Try your own explanation first. These notes stay on this page and are not saved or graded.

Show explanation

The pipeline reports a failure, and later stages that require success are skipped.

<Checkpoint title="Predict the outcome">

What happens when a required pipeline test fails?

<div slot="explanation">

The pipeline reports a failure, and later stages that require success are skipped.

</div>
</Checkpoint>

CodeFiles

Show source files with highlighting, copy controls, and downloads.

Local lab files

compose.yaml

services:
  hello:
    image: alpine:3.22
    command: ["echo", "Hello, curious engineer."]

verify.sh

#!/bin/sh
set -eu
output=$(docker compose run --rm hello)
printf '%s\n' "$output"
printf '%s\n' "$output" | grep -Fx 'Hello, curious engineer.'
echo 'Verified: the container printed the expected message.'
<CodeFiles title="Local lab files" files={[
  { src: "/labs/hello/compose.yaml" },
  { src: "/labs/hello/verify.sh" }
]} />

Steps and Step

Guide learners through a procedure with an observable result.

Inspect the service

  1. Start the service

    Terminal

    Run docker compose up -d.

    Expected observation

    docker compose ps lists a running service.

<Steps title="Inspect the service">
<Step title="Start the service" location="Terminal">

Run `docker compose up -d`.

<div slot="expected">

`docker compose ps` lists a running service.

</div>
</Step>
</Steps>

Lab

Give the exercise a goal, a way to verify the result, and a cleanup step.

HANDS-ON LAB 5 min

Start and inspect a service

Your mission

  • Check whether a Compose service is running.

Save the download as compose.yaml, then run docker compose up -d.

How to know it worked

Run docker compose ps and look for the running service.

Leave the environment clean

Run docker compose down from the same directory.

Download files
<Lab
  title="Start and inspect a service"
  duration="5 min"
  objectives={["Check whether a Compose service is running."]}
  download="/labs/hello/compose.yaml"
>

Save the download as `compose.yaml`, then run `docker compose up -d`.

<div slot="verification">

Run `docker compose ps` and look for the running service.

</div>
<div slot="cleanup">

Run `docker compose down` from the same directory.

</div>
</Lab>

Timeline and TimelineItem

Show related events in order.

TIMELINE

A change through delivery

  1. Git

    Push a commit

    The repository receives a new revision.

  2. CI

    Run the tests

    The team gets feedback on the revision.

<Timeline title="A change through delivery">
<TimelineItem date="09:00" title="Push a commit" tag="Git">

The repository receives a new revision.

</TimelineItem>
<TimelineItem date="09:05" title="Run the tests" tag="CI">

The team gets feedback on the revision.

</TimelineItem>
</Timeline>

Scenarios and Scenario

Offer alternative practice cases as tabs.

SCENARIOS

Diagnose a pipeline

A test fails

Job log
TASK

Find the failing assertion.

Open the failed job and inspect the test output.

A build succeeds

Artifacts
TASK

Find the produced file.

Open the build job and inspect the artifacts.

<Scenarios title="Diagnose a pipeline">
<Scenario title="A test fails" tab="Tests" task="Find the failing assertion." flags={["Job log"]}>

Open the failed job and inspect the test output.

</Scenario>
<Scenario title="A build succeeds" tab="Build" task="Find the produced file." flags={["Artifacts"]}>

Open the build job and inspect the artifacts.

</Scenario>
</Scenarios>

CheatSheet and CheatGroup

Turn quick references into flashcards with a list view.

CHEAT SHEET

Compose quick reference

Inspect a service

docker compose ps
List services and their status.
Inspect
docker compose logs
Read service output.
Debug
<CheatSheet title="Compose quick reference">
  <CheatGroup title="Inspect a service" span="full" items={[
    { cmd: "docker compose ps", desc: "List services and their status.", tag: "Inspect" },
    { cmd: "docker compose logs", desc: "Read service output.", tag: "Debug" }
  ]} />
</CheatSheet>
A LITTLE CLEARER?

Take a moment to explain the idea in your own words.

Progress is saved in this browser.

The Component Workshop

Course overview ↗