Skip to content

Commit ef39ba0

Browse files
authored
docs: adds additional references, concepts, and a news section (#88)
1 parent 908c04c commit ef39ba0

File tree

17 files changed

+823
-204
lines changed

17 files changed

+823
-204
lines changed

docs/mkdocs.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,20 @@ docs_dir: src
77

88
nav:
99
- Overview: index.md
10+
- News: blog/index.md
1011
- Installation: installation.md
1112
- Tutorials:
1213
- Getting Started: tutorials/getting_started.md
1314
- Concepts:
15+
- Projects: concepts/projects.md
1416
- CI: concepts/ci.md
1517
- Reference:
18+
- Blueprints: reference/blueprint.md
19+
- Deployments: reference/deployments.md
20+
- Releases:
21+
- Overview: reference/releases/index.md
22+
- Docker: reference/releases/docker.md
23+
- GitHub: reference/releases/github.md
1624
- Targets: reference/targets.md
1725

1826
theme:
@@ -45,4 +53,10 @@ markdown_extensions:
4553
- admonition
4654
- pymdownx.details
4755
- pymdownx.snippets
48-
- pymdownx.superfences
56+
- pymdownx.superfences
57+
58+
plugins:
59+
- blog:
60+
archive: false
61+
categories: false
62+
- tags

docs/src/blog/.authors.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
authors:
2+
jmgilman:
3+
name: Joshua Gilman
4+
description: Maintainer
5+
avatar: https://avatars.githubusercontent.com/u/2308444?v=4

docs/src/blog/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# News
2+
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
---
2+
draft: false
3+
date: 2024-10-25
4+
authors:
5+
- jmgilman
6+
---
7+
8+
# What's New in Forge - 10-25-2024
9+
10+
Check out what's new in Forge this week.
11+
12+
<!-- more -->
13+
14+
## Releases
15+
16+
The `publish` and `release` targets are no more!
17+
They have been replaced with an entirely new system that will enable adding more release automation going forward.
18+
Individual releases are now defined in a project's blueprint and Forge will automatically discover and execute them in the CI
19+
pipeline.
20+
Each release is run in parallel to maximize speed.
21+
22+
The old targets will no longer automatically run in the CI.
23+
You will need to configure new releases in your project's blueprint file to continue publishing/releasing.
24+
The `publish` target has been replaced with the `docker` release type.
25+
The `release` target has been replaced with the `github` release type.
26+
27+
For example, you can continue to use the `publish` target in your `Earthfile` by configuring a `docker` release type:
28+
29+
```cue
30+
project: {
31+
name: "myproject"
32+
release: {
33+
docker: {
34+
on: {
35+
merge: {}
36+
tag: {}
37+
}
38+
config: {
39+
tag: _ @forge(name="GIT_COMMIT_HASH")
40+
}
41+
target: "publish"
42+
}
43+
}
44+
}
45+
```
46+
47+
The above configuration will create a new docker release whenever a merge to the default branch occurs or when a new git tag is
48+
created.
49+
The published image will have its tag (`config.tag` above) automatically filled in with the git commit hash.
50+
Finally, Forge will call the `publish` target in your `Earthfile` to generate the container image.
51+
52+
To learn more about releases, please refer to the [reference documentation](../../reference/releases/index.md).
53+
54+
## Deployment Templates
55+
56+
A new command has been introduced to the CLI: `forge deploy template`.
57+
This command can be used to generate the raw Kubernetes manifests (in YAML) that will be applied to the target Kubernetes cluster
58+
during automatic deployments.
59+
This is useful when troubleshooting why a deplyoment may be failing or acting in an unexpected way.
60+
All generated manifests will be printed to `stdout` and can be redirected to a local file for easier viewing.
61+
62+
The below example shows what it looks like to generate the raw manifests for the Foundry API server:
63+
64+
```text
65+
$ forge deploy template foundry/api
66+
---
67+
# Instance: foundry-api
68+
---
69+
apiVersion: v1
70+
kind: Service
71+
metadata:
72+
labels:
73+
app.kubernetes.io/managed-by: timoni
74+
app.kubernetes.io/name: foundry-api
75+
app.kubernetes.io/version: 0.1.0
76+
name: foundry-api
77+
namespace: default
78+
spec:
79+
ports:
80+
- name: http
81+
port: 80
82+
protocol: TCP
83+
targetPort: http
84+
selector:
85+
app.kubernetes.io/name: foundry-api
86+
type: ClusterIP
87+
---
88+
apiVersion: apps/v1
89+
kind: Deployment
90+
metadata:
91+
labels:
92+
app.kubernetes.io/managed-by: timoni
93+
app.kubernetes.io/name: foundry-api
94+
app.kubernetes.io/version: 0.1.0
95+
name: foundry-api
96+
namespace: default
97+
spec:
98+
replicas: 1
99+
selector:
100+
matchLabels:
101+
app.kubernetes.io/name: foundry-api
102+
template:
103+
metadata:
104+
labels:
105+
app.kubernetes.io/name: foundry-api
106+
spec:
107+
containers:
108+
- image: 332405224602.dkr.ecr.eu-central-1.amazonaws.com/foundry-api:763fe7fd2bfdd39d630df9b5c5aa7e6588fc6eea
109+
imagePullPolicy: IfNotPresent
110+
livenessProbe:
111+
httpGet:
112+
path: /
113+
port: http
114+
initialDelaySeconds: 5
115+
periodSeconds: 5
116+
name: foundry-api
117+
ports:
118+
- containerPort: 8080
119+
name: http
120+
protocol: TCP
121+
readinessProbe:
122+
httpGet:
123+
path: /
124+
port: http
125+
initialDelaySeconds: 5
126+
periodSeconds: 5
127+
```
128+
129+
For more information, please refer to the [deployments documentation](../../reference/deployments.md#templating).
130+
131+
## What's Next
132+
133+
Work is currenetly being done to improve automatic deployments for projects.
134+
Currently, Forge assumes a GitOps repository exists and will automatically generate and commit updated deployments to the configured
135+
repository.
136+
This makes setup complicated and introduces a mostly unecessary step in the deployment process.
137+
138+
Instead, we are investigating having a GitOps operator (currently only Argo CD) point directly at a project's repository.
139+
Since a blueprint file is self-contained, it's possible to generate Kubernetes manifests using only the information inside of it.
140+
The first steps towards experimenting with this new solution was to create a
141+
[custom management plugin](https://github.com/input-output-hk/catalyst-forge/tree/master/tools/argocd) capable of ingesting a
142+
project and spitting out raw Kubernetes manifests.
143+
With this in place, it should be possible to point Argo CD directly at a project folder and have it generate the necessary manifests
144+
for deploying the project.
145+
As this process matures, more documentation will be released with the updated deployment process.
146+
147+
That's it for this week, thanks for tuning in!

docs/src/concepts/ci.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ It then filters and orders these targets into discrete target groups using a lis
2020
The name and dependency order of these groups is hardcoded and does not often change.
2121

2222
Each of these target groups can be considered _phases_ in the overall CI pipeline.
23-
Each phase consists of the associated targets and each phase occur in dependency order.
23+
Each phase consists of the associated targets and each phase occurs in dependency order.
2424
The name and order of these phases is hardcoded and does not often change.
2525

2626
### Execution
2727

28-
For each phase, the CI system spawns a series of parallel jobs that executes each individual target.
29-
Each target execution is given its own unique job in GitHub Actions to allow easy identification of failing targets as well as
30-
providing an isolated log stream for a single target.
28+
For each phase, the CI system spawns a series of parallel jobs that executes the current target for all discovered projects.
29+
Each project execution is given its own unique job in GitHub Actions to allow easy identification of failing targets as well as
30+
providing an isolated log stream.
3131
If any target in the group fails, the entire group is considered to be failed, and CI execution stops.
3232

3333
!!! hint
@@ -37,13 +37,12 @@ If any target in the group fails, the entire group is considered to be failed, a
3737
This promotes a "full ownership" philosophy where developers are responsible for ensuring their changes keep CI passing.
3838

3939
Projects are not required to define targets for each phase.
40-
In some cases, a phase may only contain a subset of projects.
40+
In some cases, a phase may only contain a subset of all projects in the repository.
4141
If a phase ends up with zero targets, the entire job is skipped.
4242
This allows repositories to define a small subset of targets initially and grow as project complexity increases.
4343

4444
Some target executions are limited to running the associated Earthly target and then immediately finishing.
4545
Other targets have additional logic that is executed after the target finishes running.
46-
For example, the `publish` target will automatically publish container images generated by the target to any configured registries.
4746
For more information on supported targets, please see the [reference documentation](../reference/targets.md).
4847

4948
## Extending
-43.5 KB
Loading
-43.3 KB
Loading

docs/src/concepts/projects.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Projects
2+
3+
The primary component of Catalyst Forge is the _project_.
4+
Forge is designed to interact with monorepos, where each repository contains one or more projects.
5+
A project can be classified as a discrete deliverable within a repository: it has own its dedicated process for validating,
6+
building, testing, and potentially deploying.
7+
8+
## Organizing Projects
9+
10+
!!! tip
11+
While there's no hierarchical order enforced by Forge, it's against best practices to have projects live at the root of a
12+
repository.
13+
The only exception to this case is where the repository only has a single deliverable.
14+
Since the global blueprint at the root of a repository is always unified with project blueprints, trying to configure a project
15+
in the global blueprint will result in overlapping values and will cause the parsing process to fail.
16+
17+
Catalyst Forge does not enforce projects live in any particular folder within the repository.
18+
Developers are encouraged to organize the repository in whatever way makes sense for them.
19+
The discovery mechanisms used by Forge will ensure that projects are found no matter where they live.
20+
21+
In some cases, projects may have dependencies on each other.
22+
For example, one project may have a dependency on one or more projects that provide language libraries.
23+
Whether or not these are treated as separate projects is up to developers.
24+
If a library is used by more than one project, or is consumed externally, it's recommended to treat it as a separate project.
25+
26+
## Project Components
27+
28+
Forge discovers projects within a repository using a specific set of rules.
29+
Namely, a valid project is any folder within the repository that contains a blueprint (`blueprint.cue`).
30+
This is the _only_ requirement for forge to classify that directory as a project.
31+
While a project may consist of one or more _other_ files or directories, the blueprint should always exist at the root of the
32+
project folder.
33+
34+
Optionally, a project may also contain an `Earthfile` that contains definitions for the common targets used by the
35+
[CI system](./ci.md).
36+
The CI system automatically checks for the existence of this file after it discovers a project.
37+
However, it's important to recognize the existence of an `Earthfile` _does not_ define a project according to Forge.
38+
39+
## Blueprints
40+
41+
A blueprint file contains the configuration for a project.
42+
By convention, the blueprint file is named `blueprint.cue` and is placed at the root of the project folder.
43+
A blueprint contains several options for configuring a project.
44+
Please refer to the [reference documentation](../reference/blueprint.md) for more information.
45+
46+
In addition to project blueprint files, a _global_ blueprint file can also be provided at the root of the repository.
47+
This blueprint configures global options that impact every project in the repository.
48+
The final configuration always consists of a unification of the project and global blueprints.
49+
50+
## Tagging
51+
52+
When tagging a project, it's recommended to use the following format:
53+
54+
```
55+
<project_name>/<version>
56+
```
57+
58+
Various systems within Forge are configured to automatically detect and parse this tag structure.
59+
For example, the `tag` event when configuring releases only triggers when a tag matching the current project name is found.
60+
This structure also ensures that projects are versioned separately and are easy to identify when examining tags.

docs/src/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ It is especially inspired by the principles and philosophies of
1616

1717
## Getting Started
1818

19-
If you're new to Catalyst Forge, the quickest way to get familiar with what it offers is through the getting started tutorial.
19+
If you're new to Catalyst Forge, the quickest way to get familiar with it is through the
20+
[getting started tutorial](./tutorials/getting_started.md).

0 commit comments

Comments
 (0)