Skip to content

Commit ffb16cc

Browse files
authored
Geodesic v4 (#961)
* Breaking changes * Major new features
1 parent 4aaa813 commit ffb16cc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+2454
-1530
lines changed

.coderabbit.yaml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
language: en-US
2+
tone_instructions: ''
3+
early_access: true
4+
enable_free_tier: true
5+
reviews:
6+
profile: chill
7+
request_changes_workflow: false
8+
high_level_summary: true
9+
high_level_summary_placeholder: '@coderabbitai summary'
10+
high_level_summary_in_walkthrough: false
11+
auto_title_placeholder: '@coderabbitai'
12+
auto_title_instructions: ''
13+
review_status: true
14+
commit_status: true
15+
fail_commit_status: false
16+
collapse_walkthrough: true
17+
changed_files_summary: true
18+
sequence_diagrams: false
19+
assess_linked_issues: true
20+
related_issues: true
21+
related_prs: true
22+
suggested_labels: false
23+
auto_apply_labels: false
24+
suggested_reviewers: false
25+
poem: false
26+
labeling_instructions: []
27+
path_filters: []
28+
path_instructions: []
29+
abort_on_close: true
30+
auto_review:
31+
enabled: true
32+
auto_incremental_review: true
33+
ignore_title_keywords: []
34+
labels: []
35+
drafts: false
36+
base_branches: []
37+
finishing_touches:
38+
docstrings:
39+
enabled: true
40+
tools:
41+
shellcheck:
42+
enabled: true
43+
ruff: # for Python
44+
enabled: false
45+
markdownlint:
46+
enabled: true
47+
github-checks:
48+
enabled: true
49+
timeout_ms: 90000
50+
languagetool:
51+
enabled: true
52+
enabled_only: false
53+
level: default
54+
biome: # For JavaScript/TypeScript
55+
enabled: false
56+
hadolint:
57+
enabled: true
58+
swiftlint: # For Swift
59+
enabled: false
60+
phpstan: # For PHP
61+
enabled: false
62+
level: default
63+
golangci-lint: # For Go
64+
enabled: false
65+
yamllint:
66+
enabled: true
67+
gitleaks:
68+
enabled: true
69+
checkov:
70+
enabled: true
71+
detekt: # For Kotlin
72+
enabled: false
73+
eslint: # For JavaScript/TypeScript
74+
enabled: false
75+
rubocop: # For Ruby
76+
enabled: false
77+
buf: # For Protobuf
78+
enabled: false
79+
regal: # For Rego
80+
enabled: false
81+
actionlint:
82+
enabled: true
83+
pmd: # For Java
84+
enabled: false
85+
cppcheck: # For C/C++
86+
enabled: false
87+
semgrep: # Static analysis. CodeRabbit recommends disabling this tool unless you configure specific rules for it.
88+
enabled: false
89+
circleci: # For CircleCI
90+
enabled: false
91+
chat:
92+
auto_reply: true
93+
integrations:
94+
jira:
95+
usage: disabled
96+
linear:
97+
usage: disabled
98+
knowledge_base:
99+
opt_out: false
100+
learnings:
101+
scope: auto
102+
issues:
103+
scope: auto
104+
jira:
105+
usage: disabled
106+
project_keys: []
107+
linear:
108+
usage: disabled
109+
team_keys: []
110+
pull_requests:
111+
scope: auto

.editorconfig

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1+
# top-most EditorConfig file
2+
root = true
3+
4+
# Unix-style newlines with a newline ending every file
15
[*]
6+
end_of_line = lf
27
insert_final_newline = true
8+
trim_trailing_whitespace = true
9+
charset = utf-8
310

411
# Override for Makefile
512
[{Makefile, makefile, GNUmakefile}]
@@ -13,7 +20,6 @@ indent_size = 4
1320
[*.yaml]
1421
indent_style = space
1522
indent_size = 2
16-
trim_trailing_whitespace = true
1723

1824
[*.sh]
1925
indent_style = tab

Dockerfile.custom

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# We always recommend pinning versions where changes are likely to break things.
1818
# We put the versions up top here so they are easy to find and update.
1919
# Find the latest version at https://github.com/cloudposse/geodesic/releases
20-
ARG VERSION=2.11.0
20+
ARG VERSION=4.0.0
2121
# Changing base OS for Geodesic is possible by changing this arg, but
2222
# unfortunately, the package managers are different, so it is not that simple.
2323
ARG OS=debian
@@ -45,30 +45,18 @@ ENV AWS_REGION_ABBREVIATION_TYPE=fixed
4545
ENV AWS_DEFAULT_REGION=us-west-2
4646
ENV AWS_DEFAULT_SHORT_REGION=uw2
4747

48-
# Install specific versions of Terraform.
49-
# We patch specific patch versions because Terraform will not operate
50-
# on Terraform "states" that have been touched by later versions.
51-
ARG TF_014_VERSION=0.14.10
52-
ARG TF_015_VERSION=0.15.4
53-
ARG TF_1_VERSION=1.0.4
54-
RUN apt-get update && apt-get install -y -u \
55-
terraform-0.14="${TF_014_VERSION}-*" terraform-0.15="${TF_015_VERSION}-*" \
56-
terraform-1="${TF_1_VERSION}-*"
57-
# Set Terraform 0.14.x as the default `terraform`. You can still use
58-
# version 0.15.x by calling `terraform-0.15` or version 1.x as terraform-1
59-
RUN update-alternatives --set terraform /usr/share/terraform/0.14/bin/terraform
6048

6149
# Pin kubectl minor version (must be within 1 minor version of cluster version)
6250
# Note, however, that due to Docker layer caching and the structure of this
6351
# particular Dockerfile, the patch version will not automatically update
6452
# until you change the minor version or change the base Geodesic version.
6553
# If you want, you can pin the patch level so you can update it when desired.
66-
ARG KUBECTL_VERSION=1.20
54+
ARG KUBECTL_VERSION=1.30
6755
RUN apt-get update && apt-get install kubectl-${KUBECTL_VERSION}
6856

6957
# Install Atmos CLI (https://github.com/cloudposse/atmos)
7058
RUN apt-get install atmos
7159

7260
COPY rootfs/ /
7361

74-
WORKDIR /
62+
WORKDIR /workspace

Dockerfile.options

Lines changed: 1 addition & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ ENV MAKE_INCLUDES="Makefile Makefile.*"
3131
# This is separate so that updating it does not invalidate the Docker cache layer with all the packages installed above
3232
# https://cloud.google.com/sdk/docs/release-notes
3333
ARG GOOGLE_CLOUD_CLI_VERSION
34-
ENV CLOUDSDK_CONFIG=/localhost/.config/gcloud/
34+
ENV CLOUDSDK_CONFIG=/etc/xdg_config_home/.config/gcloud/
3535

3636
RUN apt-get update && apt-get install -y google-cloud-cli=${GOOGLE_CLOUD_CLI_VERSION}-\*
3737

@@ -43,95 +43,3 @@ RUN { gcloud config set core/disable_usage_reporting true --installation && \
4343

4444

4545

46-
####################################################################################
47-
# kops support
48-
# If you are using Cloud Posse's kops reference architecture, you con configure it
49-
# in your Dockerfile like this (edit as desired)
50-
51-
ENV KOPS_CLUSTER_NAME=example.foo.bar
52-
53-
ENV KOPS_MANIFEST=/conf/kops/manifest.yaml
54-
ENV KOPS_TEMPLATE=/templates/kops/default.yaml
55-
ENV KOPS_STATE_STORE s3://undefined
56-
ENV KOPS_STATE_STORE_REGION us-east-1
57-
ENV KOPS_FEATURE_FLAGS=+DrainAndValidateRollingUpdate
58-
59-
ENV KOPS_BASTION_PUBLIC_NAME="bastion"
60-
61-
ENV KUBECONFIG=/dev/shm/kubecfg
62-
ENV KUBECONFIG_TEMPLATE=/templates/kops/kubecfg.yaml
63-
64-
RUN /usr/bin/kops completion bash > /etc/bash_completion.d/kops.sh
65-
66-
# Instance sizes for kops bastion, master nodes, and worker nodes
67-
ENV BASTION_MACHINE_TYPE "t3.small"
68-
ENV MASTER_MACHINE_TYPE "t3.medium"
69-
ENV NODE_MACHINE_TYPE "t3.medium"
70-
71-
# Min/Max number of nodes (aka workers) per region
72-
ENV NODE_MAX_SIZE 2
73-
ENV NODE_MIN_SIZE 2
74-
75-
# end of kops support section
76-
####################################################################################
77-
78-
#### ALPINE ONLY ####
79-
# Alpine does not include the very common `glibc` GNU C Standard Library, which
80-
# causes compatibility problems. Among other things, AWS CLI v2 does not work
81-
# out of the box with Alpine. The following recipe installs `glibc` , and has to be run
82-
# before installing other packages, particularly `libc6-compat`, and then,
83-
# because it conflicts, you have to tweak a bit and then install `libc6-compat`.
84-
# So put this in Dockerfile.alpine after setting up the package repositories
85-
# but before installing any packages https://github.com/cloudposse/geodesic/blob/91336bf56fb7ff0d9812e01ceacc40ca59a17cce/os/alpine/Dockerfile.alpine#L81
86-
# (Not verified)
87-
88-
# Install glibc and glibc-bin and the C.UTF-8 locale
89-
ENV LANG=C.UTF-8
90-
ARG ALPINE_GLIBC_PACKAGE_VERSION=2.33-r0
91-
RUN apk update && apk add -u curl && \
92-
ALPINE_GLIBC_PACKAGE_VERSION="${ALPINE_GLIBC_PACKAGE_VERSION}" && \
93-
curl -sSLO https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${ALPINE_GLIBC_PACKAGE_VERSION}/glibc-${ALPINE_GLIBC_PACKAGE_VERSION}.apk &&
94-
apk add --allow-untrusted glibc-${ALPINE_GLIBC_PACKAGE_VERSION}.apk && rm glibc-${ALPINE_GLIBC_PACKAGE_VERSION}.apk && \
95-
curl -sSLO https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${ALPINE_GLIBC_PACKAGE_VERSION}/glibc-bin-${ALPINE_GLIBC_PACKAGE_VERSION}.apk &&
96-
apk add --allow-untrusted glibc-bin-${ALPINE_GLIBC_PACKAGE_VERSION}.apk && rm glibc-bin-${ALPINE_GLIBC_PACKAGE_VERSION}.apk && \
97-
curl -sSLO https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${ALPINE_GLIBC_PACKAGE_VERSION}/glibc-i18n-${ALPINE_GLIBC_PACKAGE_VERSION}.apk &&
98-
apk add --allow-untrusted glibc-i18n-${ALPINE_GLIBC_PACKAGE_VERSION}.apk && rm glibc-i18n-${ALPINE_GLIBC_PACKAGE_VERSION}.apk && \
99-
/usr/glibc-compat/bin/localedef --force --inputfile POSIX --charmap UTF-8 "$LANG" || true && \
100-
printf "export LANG=%s\n" "$LANG" > /etc/profile.d/locale.sh && \
101-
apk del glibc-i18n && \
102-
rm -f /usr/glibc-compat/lib/ld-linux-x86-64.so.2 && \
103-
/usr/glibc-compat/sbin/ldconfig
104-
105-
106-
# Remove conflicting link, install libc6-compat, restore link to glibc
107-
RUN mv /lib64/ld-linux-x86-64.so.2 /lib64/glibc-ld-linux-x86-64.so.2 && \
108-
apk add --force-overwrite libc6-compat && \
109-
rm -f /lib64/ld-linux-x86-64.so.2 && \
110-
mv /lib64/glibc-ld-linux-x86-64.so.2 /lib64/ld-linux-x86-64.so.2 && \
111-
/usr/glibc-compat/sbin/ldconfig
112-
113-
114-
# Now you can install packages
115-
# https://github.com/cloudposse/geodesic/blob/91336bf56fb7ff0d9812e01ceacc40ca59a17cce/os/alpine/Dockerfile.alpine#L81-L88
116-
117-
118-
# Now you can move AWS CLI v1 aside, keep it as an alternative, and install AWS CLI v2
119-
120-
# Move AWS CLI v1 to aws1 and set up alternatives
121-
RUN mv /usr/bin/aws /usr/local/bin/aws1 && \
122-
update-alternatives --install /usr/local/bin/aws aws /usr/local/bin/aws1 1
123-
124-
125-
# Install AWS CLI 2
126-
# Get version from https://github.com/aws/aws-cli/blob/v2/CHANGELOG.rst
127-
# We cannot automatically track the release versions, so we just install the latest
128-
# ARG AWS_CLI_VERSION=2.1.34
129-
RUN AWSTMPDIR=$(mktemp -d -t aws-inst-XXXXXXXXXX) && \
130-
curl -sSsSL "https://awscli.amazonaws.com/awscli-exe-linux-x86_64${AWS_CLI_VERSION:+-${AWS_CLI_VERSION}}.zip" -o "$AWSTMPDIR/awscliv2.zip" && \
131-
cd $AWSTMPDIR && \
132-
unzip -qq awscliv2.zip && \
133-
./aws/install -i /usr/share/aws/v2 -b /usr/share/aws/v2/bin && \
134-
update-alternatives --install /usr/local/bin/aws aws /usr/share/aws/v2/bin/aws 2 && \
135-
rm -rf $AWSTMPDIR
136-
137-

Makefile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,22 @@ build: $(DOCKER_BASE_OS).build
4747
install: $(DOCKER_BASE_OS).install
4848

4949
run:
50-
@geodesic
50+
@$(APP_NAME)
51+
52+
run/solo:
53+
@$(APP_NAME) --solo
5154

5255
%.run: %.build %.install
53-
@geodesic
56+
@$(APP_NAME)
5457

5558
run/check:
5659
@if [[ -n "$$(docker ps --format '{{ .Names }}' --filter name="^/$(APP_NAME)\$$")" ]]; then \
5760
printf "**************************************************************************\n" ; \
5861
printf "Not launching new container because old container is still running.\n"; \
59-
printf "Exit all running container shells gracefully or kill the container with\n\n"; \
60-
printf " docker kill %s\n\n" "$(APP_NAME)" ; \
62+
printf "Exit all running container shells gracefully or quit the container with\n\n"; \
63+
printf " %s stop\n\n" "$(APP_NAME)" ; \
64+
printf "Then, all new shells will be running in the same new container.\n\n" ; \
65+
printf "Alternately, run \`make run/solo\` or \`$(APP_NAME) --solo\` to start a new container.\n" ; \
6166
printf "**************************************************************************\n" ; \
6267
exit 9 ; \
6368
fi

README.md

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,20 @@ We recommend starting by using `geodesic` as a Docker base image (e.g. `FROM clo
7676
> Starting with Geodesic 2.0, we distributed Geodesic as a multi-platform (`linux/amd64`, `linux/arm64`) Debian-based Docker image and a single-platform (`linux/amd64`) Alpine-based image.
7777
> We moved the `cloudposse/geodesic:latest` Docker image tag from the Alpine version to the Debian version at that time.
7878
79+
80+
### What’s Changed in Geodesic 4.0
81+
82+
Geodesic 4.0 is a major release that brings many new features and improvements. The most notable changes are:
83+
84+
- The first launched shell is no longer special. All shells are now equal, and you can quit them in any order.
85+
The geodesic container remains running until the last shell exits.
86+
- The `geodesic` command now has a `--solo` option that allows you to launch a new Geodesic container for just that one shell.
87+
- Geodesic no longer mounts the host user's entire home directory into the container. Instead, it mounts only selected directories.
88+
- The `geodesic stop` command has been enhanced to shut down the Geodesic container gracefully, rather than forcefully, allowing,
89+
among other things, shell scripts to run their exit handlers.
90+
91+
See extensive release notes for Geodesic 4.0 [here](ReleaseNotes-v4.md).
92+
7993
### What’s Changed in Geodesic 3.0
8094

8195
Rather than bringing new features, Geodesic 3.0 is focused on slimming down the Docker image and removing outdated tools.
@@ -136,9 +150,9 @@ The `latest` tag points to the latest Debian-based image, although we recommend
136150

137151
### Quickstart
138152

139-
#### docker run
153+
#### Installing Geodesic
140154

141-
Launching Gedoesic is a bit complex, so we recommend you install a launch script by running
155+
Launching Geodesic is a bit complex, so we recommend you install a launch script by running
142156
```
143157
docker run --rm cloudposse/geodesic:latest-debian init | bash
144158
```
@@ -147,14 +161,28 @@ After that, you should be able to launch Geodesic just by typing
147161
geodesic
148162
```
149163

164+
Alternately, customize the Makefile as described below and use `make install` to build your custom image
165+
and install the launch script.
166+
167+
#### Running Geodesic
168+
169+
Geodesic has only a few commands and command-line options. The most important command is `geodesic`, which launches the Geodesic shell.
170+
The only other command you might normally use is `geodesic stop`, which stops the Geodesic container, but
171+
Geodesic automatically quits (and removes the Docker container) when you exit the last shell, so you should rarely need to use `geodesic stop`.
172+
173+
Run `geodesic help` for a list of command-line options.
174+
175+
See [customization](/docs/customization.md) documentation for information on how to customize your Geodesic environment.
176+
Geodesic has many customization options, but they are most commonly set in configuration files, not on the command line.
177+
150178
### Customizing your Docker image
151179

152180
In general we recommend creating a customized version of Geodesic by creating your own `Dockerfile` starting with
153181
```
154182
# We always recommend pinning versions to avoid surprises and breaking changes.
155183
# We put the version up top here so it is easy to find and update.
156184
# Find the latest version at https://github.com/cloudposse/geodesic/releases
157-
ARG VERSION=3.0.0
185+
ARG VERSION=4.0.0
158186
# If you don't want to bothered with updating the version, you can use `latest` instead,
159187
# but keep in mind that as long as you have a local image with the `latest` tag,
160188
# it will not be updated by `docker run`. You will have to explicitly pull the latest image.
@@ -170,6 +198,17 @@ ENV BANNER="my-custom-geodesic"
170198

171199
You can see some example configuration options to include in [Dockerfile.options](./Dockerfile.options).
172200

201+
#### Makefile customizations
202+
203+
We also recommend creating a `Makefile` to simplify building and running your custom image.
204+
You can use the [Makefile](/Makefile) in this repository with minimal modifications.
205+
206+
- Update `DOCKER_ORG` and `DOCKER_IMAGE` to match your Docker Hub username and the name of your custom image.
207+
- Update `DOCKER_FILE` to match the path to your custom `Dockerfile`.
208+
- Update `APP_NAME` to give the command to launch your custom image a custom name.
209+
210+
Then you can build your custom image with `make build` and run it with `make run`.
211+
173212
#### Multi-platform gotchas
174213

175214
Although the Geodesic base image is provided in 2 architectures, when you do a local build
@@ -324,7 +363,7 @@ All other trademarks referenced herein are the property of their respective owne
324363

325364

326365
---
327-
Copyright © 2017-2024 [Cloud Posse, LLC](https://cpco.io/copyright)
366+
Copyright © 2017-2025 [Cloud Posse, LLC](https://cpco.io/copyright)
328367

329368

330369
<a href="https://cloudposse.com/readme/footer/link?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/geodesic&utm_content=readme_footer_link"><img alt="README footer" src="https://cloudposse.com/readme/footer/img"/></a>

0 commit comments

Comments
 (0)