Skip to content

Commit 9c3e422

Browse files
fix: Update documentation after codelab at Devoxx France 2025 (#52)
* fix: manual installation * feat: add documentation to use local vscode with codespace * fix: use folder .dagger instead of dagger suggered by dagger contibutor * Update 03-utiliser-module-daggerverse.md * fix: Update after review * update devcontainer with latest versions * small fix * fix version * fix: version and typo * fix * english update * update --------- Co-authored-by: Julien Haumont <3694732+jhaumont@users.noreply.github.com> Co-authored-by: Julien Haumont <julien.haumont@zenika.com>
1 parent 3b5367f commit 9c3e422

File tree

14 files changed

+92
-33
lines changed

14 files changed

+92
-33
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{
55
"name": "Go Devcontainer",
66

7-
"image": "adrienaury/go-devcontainer:v5.1.0",
7+
"image": "adrienaury/go-devcontainer:v6.0.1",
88

99
// Add the IDs of extensions you want installed when the container is created.
1010
"customizations": {

.devcontainer/install-dagger.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
mkdir -p "$HOME/.local/bin"
4-
curl -fsSL https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.18.3 BIN_DIR=$HOME/.local/bin sh
4+
curl -fsSL https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.18.10 BIN_DIR=$HOME/.local/bin sh
55
sudo su <<EOF
66
echo "alias ll='ls -al'" >> $HOME/.zshrc
77
echo "PATH=$PATH:$HOME/.local/bin" >> $HOME/.zshrc

.github/workflows/CI.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ name: CI hello
22
on:
33
pull_request:
44
branches:
5-
- 'main'
5+
- "main"
66
push:
77
branches:
8-
- 'main'
8+
- "main"
99

1010
jobs:
1111
CI:

runbooks/codespace-2.png

22.7 KB
Loading

runbooks/english/01-setup.md

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22

33
To run this codelab, you have 2 choices:
44

5-
- Use GitHub Codespace by clicking on the button bellow (**recommended**)
5+
- Use GitHub [Codespace](#codespace) by clicking on the button bellow (**recommended**)
66
- Install all prerequisites and Dagger on your computer (see section [Local installation](#local-installation) of this document)
77

8-
## Fork this repository
8+
## Codespace
9+
10+
### Repository fork
911

1012
Please, fork this repository. With your fork, you can commit & push to save your work.
1113

12-
## Codespace
14+
### Codespace creation
1315

1416
Click on the button bellow:
1517

@@ -19,23 +21,41 @@ In the codespace's creation's page, keep in mind to **change the repository name
1921

2022
![](../codespace.png)
2123

24+
Codespace environnement can take few minutes.
25+
26+
Now, you are ready to go to next page [Getting started with Dagger](02-getting-started-with-Dagger.md)
27+
28+
> [!TIP]
29+
> If the code space loading page is still displayed, scroll to bottom of [Codespace page](https://github.com/codespaces/)
30+
> ![](../codespace-2.png)
31+
>
32+
> If status is `Active`, that means the codespace is ready, but web page is blocked maybe due to too many call from same IP addresses (in case of codelab with too many people). Voir [Se connecter à VSCode (optionnel)](#se-connecter-à-vscode-optionnel).
33+
34+
### Connect to VSCode (optional)
35+
36+
You can connect your local VSCode (from your computer) directly to codespace environnement. To do that, please read [official documentation](https://docs.github.com/en/codespaces/developing-in-a-codespace/using-github-codespaces-in-visual-studio-code).
37+
2238
## Local installation
2339

40+
### Repository fork
41+
42+
Please, fork this repository. With your fork, you can commit & push to save your work.
43+
44+
### Configuration
45+
2446
To run this codelab, your need install all of components bellow:
2547

2648
- Under Windows, WSL2 is highly recommended (but you can use an other virtualization manager like [Virtualbox](https://www.virtualbox.org))
2749
- Install **Docker for Windows/Mac** or **Rancher Desktop**
2850
- Install [Git](https://git-scm.com/)
2951
- Install [Go](https://go.dev/doc/install) language `1.23.x`
30-
- Install [Dagger](https://docs.dagger.io/quickstart/cli/) version `0.18.3`
52+
- Install [Dagger](https://docs.dagger.io/install/) version `0.18.10`
3153
- Example for linux:
3254
```bash
33-
curl -fsSL https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.18.3 $HOME/.local/bin sh
55+
curl -fsSL https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.18.10 BIN_DIR=$HOME/.local/bin sh
3456
```
3557

3658
> [!TIP]
3759
> If you have any issue with Docker credential by using WSL2, you can try this fix it by following instruction given on this website https://forums.docker.com/t/docker-credential-desktop-exe-executable-file-not-found-in-path-using-wsl2/100225/5
3860

39-
## Getting Started with Dagger
40-
4161
Now, you are ready to go to next page [Getting started with Dagger](02-getting-started-with-Dagger.md)

runbooks/english/02-getting-started-with-Dagger.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ cd hello
2020
2121
Init your Dagger module:
2222
```bash
23-
dagger init --sdk=go --source=./dagger
23+
dagger init --sdk=go --source=.dagger
2424
```
2525

2626
This command will download and run the container image of Dagger engine (based on your CLI version) and generate skeleton of your Dagger module:
2727
- a `dagger.json` file that contains metadata,
28-
- a `dagger` folder:
28+
- a `.dagger` folder:
2929
- a `main.go` file that will contains your module's code,
3030
- a `dagger.gen.go` file and a `internal` folder that contains utily code generated by Dagger,
3131

32-
In the `dagger/main.go` file, replace the existing code with the one below:
32+
In the `.dagger/main.go` file, replace the existing code with the one below:
3333

3434
```go
3535
package main
@@ -84,7 +84,7 @@ return dag.Container().
8484
> [!WARNING]
8585
> The `dagger.gen.go` has compilation issue in VSCode (file is red).
8686
>
87-
> When we change content of `dagger/main.go` file, public interface changes and the code generation needs to happen again.
87+
> When we change content of `.dagger/main.go` file, public interface changes and the code generation needs to happen again.
8888
>
8989
> We must regenerate the Dagger module's code with command:
9090
> ```bash
@@ -149,6 +149,13 @@ export DAGGER_CLOUD_TOKEN=<token>
149149

150150
You can add this to your `.profile` (or anything else) to avoid entering it every time you close and open your shell.
151151

152+
Or more simple, you can directly logging on Dagger :
153+
154+
```bash
155+
dagger login
156+
```
157+
158+
152159
## Interact with the result of your function
153160

154161
When your function returns a container type, you can interact with it to inspect its content.

runbooks/english/03-use-module-from-daggerverse.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Another solution is to read directly the souce code: https://github.com/vito/dag
5454

5555
### Change BuildEnv function
5656

57-
Add a `builder` field of type `*dagger.Go` to the `Hello` struct in file `dagger/main.go`:
57+
Add a `builder` field of type `*dagger.Go` to the `Hello` struct in file `.dagger/main.go`:
5858
```go
5959
type Hello struct {
6060
builder *dagger.Go
@@ -84,7 +84,7 @@ Now, this function no longer returns a container, but modifies `builder` instanc
8484
8585
### Update Build function
8686
87-
Replace the `Build` function by bellow code in the file `dagger/main.go`:
87+
Replace the `Build` function by bellow code in the file `.dagger/main.go`:
8888
```go
8989
// Build the application container
9090
func (m *Hello) Build(source *dagger.Directory) *dagger.Container {

runbooks/english/04-use-module-in-github-actions.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,7 @@ You now have a CI pipeline for the `hello` application!
2828

2929
The pipeline is executed on GitHub Action using our Dagger module! This allows you to use the same pipeline locally and in GitHub Actions.
3030

31+
> [!TIP]
32+
> You can install the GitHub app Dagger inside your repository to link directly inside the PR the build traces on Dagger Cloud. CF https://github.com/apps/dagger-cloud
33+
3134
Now, we will expore the Dagger shell, to do same but without any code: [Introducing Dagger Shell](./05-use-interactive-dagger-shell.md).

runbooks/french/01-setup.md

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22

33
Pour réaliser ce codelab, vous avez 2 possibilités :
44

5-
- Utiliser le GitHub Codespace mis à disposition (**méthode recommandée**)
5+
- Utiliser le GitHub [Codespace](#codespace) mis à disposition (**méthode recommandée**)
66
- Installer les prérequis et Dagger sur votre machine (voir section [Installation locale](#installation-locale) de ce document)
77

8-
## Fork du repository
8+
## Codespace
9+
10+
### Fork du repository
911

1012
Faire un fork de ce repository. Avec ce fork, vous pouvez commit et pousser votre travail pour le sauvegarder.
1113

12-
## Codespace
14+
### Création du codespace
1315

1416
Cliquez sur le bouton ci-dessous et laissez vous porter par la magie :
1517

@@ -19,23 +21,41 @@ Dans la fenêtre de création du codespace, pensez à **changer le repository po
1921

2022
![](../codespace.png)
2123

24+
La création de l'environnement codespace prend quelques minutes.
25+
26+
Une fois le codespace déployé, allez à la page [Getting started with Dagger](02-getting-started-with-Dagger.md)
27+
28+
> [!TIP]
29+
> Si la page de chargement reste bloquée, allez tout en bas de la page [Codespace](https://github.com/codespaces/) :
30+
> ![](../codespace-2.png)
31+
>
32+
> Si le statut est `Active`, le codespace est bien créé mais l'ihm est bloqué, peut-être à cause d'un trop grand nombre de connexions depuis la même adresse IP (dans le cas d'un codelab lors d'une conférence). Voir [Se connecter à VSCode (optionnel)](#se-connecter-à-vscode-optionnel).
33+
34+
### Se connecter à VSCode (optionnel)
35+
36+
Vous pouvez connecter l'instance VSCode de votre ordinateur à l'environnement codespace. Pour cela, suivez la [documentation officielle](https://docs.github.com/en/codespaces/developing-in-a-codespace/using-github-codespaces-in-visual-studio-code).
37+
2238
## Installation locale
2339

40+
### Fork du repository
41+
42+
Faire un fork de ce repository. Avec ce fork, vous pouvez commit et pousser votre travail pour le sauvegarder.
43+
44+
### Configuration
45+
2446
Voici les éléments à mettre en place pour réaliser le codelab sur votre machine :
2547

2648
- Avec Windows l'utilisation de WSL2 est recommandée (vous pouvez toutefois utiliser un système de virtualisation comme [Virtualbox](https://www.virtualbox.org))
2749
- Avoir Docker installé sur votre machine (via **Docker for Windows/Mac** ou **Rancher Desktop** pour Windows et Mac OS)
2850
- Installer un client [Git](https://git-scm.com/)
2951
- Installer la version `1.23.x` du langage [Go](https://go.dev/doc/install)
30-
- Installer le client [Dagger](https://docs.dagger.io/quickstart/cli/) version `0.18.3`
52+
- Installer le client [Dagger](https://docs.dagger.io/install/) version `0.18.10`
3153
- Exemple pour linux:
3254
```bash
33-
curl -fsSL https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.18.3 $HOME/.local/bin sh
55+
curl -fsSL https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.18.10 BIN_DIR=$HOME/.local/bin sh
3456
```
3557

3658
> [!TIP]
3759
> En cas de soucis avec les identifiants docker sur WSL2, essayer la solution suivante https://forums.docker.com/t/docker-credential-desktop-exe-executable-file-not-found-in-path-using-wsl2/100225/5
3860

39-
## Getting Started with Dagger
40-
41-
Une fois prêts, démarrer le allez à la page [Getting started with Dagger](02-getting-started-with-Dagger.md)
61+
Une fois la configuration terminée, allez à la page [Getting started with Dagger](02-getting-started-with-Dagger.md)

runbooks/french/02-getting-started-with-Dagger.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ cd hello
2020
2121
Initialisez votre module de Dagger :
2222
```bash
23-
dagger init --sdk=go --source=./dagger
23+
dagger init --sdk=go --source=.dagger
2424
```
2525
2626
Cette commande va télécharger l'image du conteneur Dagger engine (liée à votre version du CLI), le démarrer et générer votre structre de module Dagger :
2727
- Un fichier `dagger.json` de metadata,
28-
- Un répertoire `dagger` :
28+
- Un répertoire `.dagger` :
2929
- Un fichier `main.go` qui va contenir le code de votre module,
3030
- Un ficher `dagger.gen.go` et un répertoire `internal` contenant le code utilitaire généré par Dagger,
3131
32-
Dans le fichier `dagger/main.go`, remplacez le code existant par celui ci-dessous :
32+
Dans le fichier `.dagger/main.go`, remplacez le code existant par celui ci-dessous :
3333
3434
```go
3535
package main
@@ -84,7 +84,7 @@ return dag.Container().
8484
> [!WARNING]
8585
> Le fichier `dagger.gen.go` apparait comme ayant un problème de compilation dans VSCode (le fichier est rouge).
8686
>
87-
> En changeant le contenu du fichier `dagger/main.go`, l'interface a évolué.
87+
> En changeant le contenu du fichier `.dagger/main.go`, l'interface a évolué.
8888
>
8989
> Il faut regénérer le code Dagger du module, avec la commande ci-dessous :
9090
> ```bash
@@ -151,6 +151,12 @@ export DAGGER_CLOUD_TOKEN=<token>
151151
152152
Pour ne plus avoir à le faire à chaque ouverture de session/terminal, il faut ajouter ce token à votre contexte (`.profile` ou autre).
153153
154+
Ou plus simple, vous pouvez directement vous logger sur Dagger avec :
155+
156+
```bash
157+
dagger login
158+
```
159+
154160
## Intéragir avec le résultat de votre fonction
155161
156162
Lorsque votre fonction retourne un type "container", vous avez la possibilité d'interagir avec cette dernière pour inspecter son contenu.

0 commit comments

Comments
 (0)