#geodesic (2023-01)

geodesic https://github.com/cloudposse/geodesic

Discussions related to https://github.com/cloudposse/geodesic

Archive: https://archive.sweetops.com/geodesic/

2023-01-10

Nic'H avatar

Hi, just trying Geodesic and got an issue with git when doing a git clone (any repo) , it returns a certificate validation error :

Cloning into 'tutorials'...
fatal: unable to access '<https://github.com/cloudposse/tutorials/>': server certificate verification failed. CAfile: none CRLfile: none

If I disable ssl verification, then it clones fine, but it means I have to do that anytime I restart the container.

git config --global http.sslVerify false

git version 2.30 geodesic version : latest run on mac M1

Any idea about this ?

Cody avatar

Hi there, I have a Makefile from you guys in a project that has been managing our terraform for a few years. Running any of the Make targets is just hanging, not doing anything. For example, make all or make run. After typing the command and hitting enter, it just hangs at the prompt. Has anyone else experienced anything like this that you’ve heard? It is untouched in a long time, and I ran it as recently as last week.

Cody avatar

I’m trying to manage infrastructure for a very large enterprise, and suddenly can’t do anything, any help would be very appreciated

Cody avatar

here is the makefile with the enterprise clients name obfuscated out with ***

export HOME_DIR ?= /home/code
export STORAGE_DIR ?= /mnt/storage
export PROJECTS_DIR ?= $(STORAGE_DIR)/projects
export DOCKER_ORG ?= grizzlyforce
export DOCKER_IMAGE ?= $(DOCKER_ORG)/***-atmos
export DOCKER_TAG ?= latest
export DOCKER_IMAGE_NAME ?= $(DOCKER_IMAGE):$(DOCKER_TAG)
export APP_NAME = ***-atmos
GEODESIC_INSTALL_PATH ?= /home/code/.local/bin
export INSTALL_PATH ?= $(GEODESIC_INSTALL_PATH)
export SCRIPT = $(INSTALL_PATH)/$(APP_NAME)
export ADR_DOCS_DIR = docs/adr
export ADR_DOCS_README = $(ADR_DOCS_DIR)/README.md
BUILD_HARNESS_EXTENSIONS_PATH := $(CURDIR)/.build-harness-extensions

-include $(shell curl -sSL -o .build-harness "<https://cloudposse.tools/build-harness>"; echo .build-harness)

.DEFAULT_GOAL := default

## Initialize build-harness, install deps, build docker container, install wrapper script and run shell
all: init deps build install run
	@exit 0

## Install dependencies (if any)
deps:
	@exit 0

## Build docker image
build:
	@make --no-print-directory docker/build

## Push docker image to registry
push:
	@$(call fail,Refusing to push $(DOCKER_IMAGE_NAME) to docker hub)

## Install wrapper script from geodesic container
install:
	@docker run --rm $(DOCKER_IMAGE_NAME) | bash -s $(DOCKER_TAG) || (echo "Try: sudo make install"; exit 1)

## Start the geodesic shell by calling wrapper script
run:
	docker run -ti --rm -v $(HOME_DIR):/localhost -v $(PROJECTS_DIR):/localhost/projects  -v $(STORAGE_DIR)/cody/.aws:/localhost/.aws -v $(STORAGE_DIR)/cody/.ssh:/localhost/.ssh grizzlyforce/***-atmos
Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

@Jeremy White (Cloud Posse) can you share how you fixed it?

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

(it’s related to the latest version of Make)

Cody avatar

i had a feeling this was the case, thanks Erik. I’m on arch so i’ve rolled into the latest version i guess

Jeremy White (Cloud Posse) avatar
Jeremy White (Cloud Posse)

Aloha, yeah, I had this happen. Can you share your make version with make --version ?

Cody avatar

GNU Make 4.4

Jeremy White (Cloud Posse) avatar
Jeremy White (Cloud Posse)

aha, I think this is the related issue: https://github.com/cloudposse/build-harness/issues/333

#333 make 4.4 (oct 31 2022) causes issues with the git submodule resulting in an infinite loop

Found a bug? Maybe our Slack Community can help.

Slack Community

Describe the Bug

make 4.4 (oct 31 2022) causes issues with the git submodule resulting in an infinite loop

https://ftp.gnu.org/gnu/make/

cc: @Nuru

Expected Behavior

It should not be in an infinite loop

Steps to Reproduce

  1. Use the ancient OSX make which is 3.81 version
  2. /usr/bin/make init
  3. Notice that the target exits successfully
  4. Use the GNU make by doing brew install make to get the latest 4.4 version
  5. /usr/local/bin/make init
  6. Notice the infinite loop
✗ make SHELL='sh -x' init

+ pwd
+ pwd
+ '[' -d build-harness ']'
+ pwd
+ config --get remote.origin.url
+ sed 's/\.git$//g'
+ sed 's/git@\(.*\):/https:\/\/\1\//g'
+ show -s --format=%aN
+ show -s --format=%aN
+ config --get remote.origin.url
+ sed 's/\.git$//g'
+ sed 's/git@\(.*\):/https:\/\/\1\//g'
+ rev-parse --verify --short HEAD
+ config --get remote.origin.url
+ sed 's/\.git$//g'
+ sed 's/git@\(.*\):/https:\/\/\1\//g'
+ rev-parse --verify --short HEAD
+ rev-parse --verify --short HEAD
+ config --get remote.origin.url

Screenshots

N/A

Environment (please complete the following information):

• OSX Ventura 13.0 • GNU Make 4.4

Additional Context

Worked on debugging this with @dudymas on it! Thank you!

Downgrading back to make 4.3 is successful

Commenting out this line prevents the issue

build-harness/Makefile

Line 42 in 72ee8e2

And the git module is the specific one that seems to be failing which causes repeating the include.

build-harness/modules/git/bootstrap.Makefile

Lines 11 to 17 in 72ee8e2

Workaround Option 1: Use OSX make

/usr/bin/make --version
/usr/bin/make all

Option 2: Brew to pin GNU Make

if you do not want to use the older make but also want to pin to 4.3 using homebrew

Brew make.rb raw 4.3 formulaBrew make.rb formula

# uninstall 4.4 make
brew uninstall make
# find your make.rb file
find / -name make.rb
# override the make.rb file with the 4.3 version
wget <https://raw.githubusercontent.com/Homebrew/homebrew-core/9345e061435f18a91437cc5a3db34a90acbb9f1b/Formula/make.rb> \
  -O /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/make.rb
# install
brew install make
# finally pin
brew pin make
Jeremy White (Cloud Posse) avatar
Jeremy White (Cloud Posse)

but I have a quick way to check

Jeremy White (Cloud Posse) avatar
Jeremy White (Cloud Posse)

try running /usr/bin/make all

Cody avatar

@Jeremy White (Cloud Posse) going to try this now, thank you for the info and patience, i got delayed on other things

Cody avatar

I ran the make SHELL='sh -x' init and did experience the infinite loop

Cody avatar

is the only option for now to rollback make @Jeremy White (Cloud Posse)?

Cody avatar
Continue looping over submodules with the "git submodule foreach" command after a non-zero exit

I have a project that contains many submodules. I want to loop over each submodule with the following command:

git submodule foreach npm install

And I want the script to continue looping over each

Cody avatar

in the build harness, it looks like git submodule –init –recursive could be replaced with

git submodule foreach --remote 'git fetch | 0'
git submodule foreach --remote 'git merge origin master | 0'

or something like this

Jeremy White (Cloud Posse) avatar
Jeremy White (Cloud Posse)

to be clear, you tried with the old make binary? /usr/bin/make ?

Cody avatar

i did not

Cody avatar

but i was able to replicate the forever loop

Cody avatar

from that github issue

Cody avatar

/usr/bin/make for me is also 4.4

Jeremy White (Cloud Posse) avatar
Jeremy White (Cloud Posse)

we’ve been able to recreate the loop issue as well, so this is definitely a confirmed regression with newer make

Cody avatar

lol very annoying

Jeremy White (Cloud Posse) avatar
Jeremy White (Cloud Posse)

aha, okay, that complicates things.

Cody avatar

yeah, in arch there is a project for rolling back packages, not sure what other issues that will cause. I could also just build and install an older version myself i guess

Cody avatar

and symlink to it or something

Jeremy White (Cloud Posse) avatar
Jeremy White (Cloud Posse)

well, there is also the chance you can replace the formula in brew with the make 4.3 script

Cody avatar

oh i dont use brew, im not on a mac

Cody avatar

its arch linux

Jeremy White (Cloud Posse) avatar
Jeremy White (Cloud Posse)

also, if you are use nix, I can give you a nix-shell command to try

Cody avatar

well, endeavour

Cody avatar

hmmm, i dont use nix, but i suppose i could do that as well

Cody avatar

no time like the present to get hooked on another tool like nix lol

Jeremy White (Cloud Posse) avatar
Jeremy White (Cloud Posse)

nix is honestly the easiest way to have an old binary for things like this while bugs are squashed. the command would be nix-shell -p gnumake42

Jeremy White (Cloud Posse) avatar
Jeremy White (Cloud Posse)

which would hopefully give you a make 4.2 binary in your PATH to quickly unblock

Jeremy White (Cloud Posse) avatar
Jeremy White (Cloud Posse)

but if you don’t have it set up, that can take time

Cody avatar

i see, yeah, i’ve read plenty about it, but never attempted to set it up

Cody avatar

haha i can’t remove make because dkms relies on it

Cody avatar

so i think installing the downgrade beside it is my only option

Jeremy White (Cloud Posse) avatar
Jeremy White (Cloud Posse)

of you don’t want to remember the command, you can commit a file shell.nix and put this inside it:

{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
  nativeBuildInputs = with pkgs; [
    gnumake42
  ];
}
Cody avatar

such a huge project to get held up on, just my luck haha

Jeremy White (Cloud Posse) avatar
Jeremy White (Cloud Posse)

well, we’re hoping to squash this bug soon

Jeremy White (Cloud Posse) avatar
Jeremy White (Cloud Posse)

I just cannot say if it will be soon enough for you

Cody avatar

makes sense, i provided a potential solution above. have you guys tried to approach this in any way yet?

Cody avatar

in the build harness, it looks like git submodule –init –recursive could be replaced with

git submodule foreach --remote 'git fetch | 0'
git submodule foreach --remote 'git merge origin master | 0'

or something like this

Jeremy White (Cloud Posse) avatar
Jeremy White (Cloud Posse)

also, have you tried the change you mentioned above? to alter the git submodule line?

Cody avatar

i haven’t, but i could, if i can figure out where that gets called

Cody avatar

i dont entirely understand where i would change something to call a different build-harness

Cody avatar

i could fork the harness though if you can tell me where that gets pulled in

Jeremy White (Cloud Posse) avatar
Jeremy White (Cloud Posse)

the include line is in the makefile, around line 25

Jeremy White (Cloud Posse) avatar
Jeremy White (Cloud Posse)

I’m going to try to find the line you speak of… if I can test it, I’ll holler

Cody avatar

i found the call for the build-harness, will attempt

Cody avatar

Ok, I did the following: • commented out the line in the Makefile that downloads the build-harness makefile from cloudposse.tools/build-harness • altered the previously downloaded file to use my forked build-harness repo (grizzlyforce/build-harness) • updated the forked repo to use git fetch / git merge • ran make run successfully

Cody avatar

i can’t run make all or make build though which tells me my solution is probably not a complete solution?

Cody avatar
➜ make build
make[1]: *** No rule to make target 'docker/build'.  Stop.
make: *** [Makefile:30: build] Error 2
Cody avatar

I think I need to host my own version of that cloudposse.tools/build-harness makefile

Jeremy White (Cloud Posse) avatar
Jeremy White (Cloud Posse)

okay… can you link to any files you changed?

Cody avatar

one sec, let me take this a step further, i just realised that file is actually in the repo, so i also have it hosted and can change to my version

Jeremy White (Cloud Posse) avatar
Jeremy White (Cloud Posse)

gotcha

Cody avatar

it still infinite loops, so it must be before my change

Cody avatar

I searched geodesic and build-harness for ‘submodule’ and the only call i found was in build-harness/modules/git/Makefile

Cody avatar

is there somewhere else that i’m missing?

Jeremy White (Cloud Posse) avatar
Jeremy White (Cloud Posse)

I wasn’t able to find it anywhere else either

Jeremy White (Cloud Posse) avatar
Jeremy White (Cloud Posse)

but

Jeremy White (Cloud Posse) avatar
Jeremy White (Cloud Posse)

I am suspect of the bootstrap.Makefile in the git module. It has a trailing endif and I don’t like the way that looks…

Cody avatar
➜ make SHELL='sh -x' all
+ curl -sSL -o .build-harness <https://raw.githubusercontent.com/grizzlyforce/build-harness/master/templates/Makefile.build-harness>
+ echo .build-harness
+ pwd
+ pwd
+ '[' -d build-harness ']'
+ pwd
+ config --get remote.origin.url
+ sed 's/git@\(.*\):/https:\/\/\1\//g'
+ sed 's/\.git$//g'
+ show -s --format=%aN
+ show -s --format=%aN
+ config --get remote.origin.url
+ sed 's/\.git$//g'
+ sed 's/git@\(.*\):/https:\/\/\1\//g'
+ rev-parse --verify --short HEAD
+ config --get remote.origin.url
+ sed 's/git@\(.*\):/https:\/\/\1\//g'
+ sed 's/\.git$//g'
+ rev-parse --verify --short HEAD
+ rev-parse --verify --short HEAD
+ config --get remote.origin.url
+ sed 's/\.git$//g'
+ sed 's/git@\(.*\):/https:\/\/\1\//g'
+ rev-parse --verify --short HEAD
+ show -s --format=%aN
+ show -s --format=%aN
+ rev-parse --verify --short HEAD
+ rev-parse --verify --short HEAD
+ show -s --format=%aN
+ config --get remote.origin.url
+ sed 's/\.git$//g'
+ sed 's/git@\(.*\):/https:\/\/\1\//g'
+ show -s --format=%aN
+ rev-parse --verify --short HEAD
+ rev-parse --verify HEAD
+ config --get remote.origin.url
+ sed 's/\.git$//g'
+ sed 's/git@\(.*\):/https:\/\/\1\//g'
+ show -s --format=%aN
+ show -s --format=%aN
+ config --get remote.origin.url
+ sed 's/\.git$//g'
+ sed 's/git@\(.*\):/https:\/\/\1\//g'
+ rev-parse --verify HEAD
+ config --get remote.origin.url
+ sed 's/\.git$//g'
+ sed 's/git@\(.*\):/https:\/\/\1\//g'
+ rev-parse --verify HEAD
+ rev-parse --verify HEAD
+ config --get remote.origin.url
+ sed 's/\.git$//g'
+ sed 's/git@\(.*\):/https:\/\/\1\//g'
Jeremy White (Cloud Posse) avatar
Jeremy White (Cloud Posse)

the issue by rb claims that the bootstrapper is what causes the loop

Jeremy White (Cloud Posse) avatar
Jeremy White (Cloud Posse)

and if you comment out the include for the bootstrap.Makefile includes, it works. I’ll test that now

Jeremy White (Cloud Posse) avatar
Jeremy White (Cloud Posse)

confirmed that fixes it for me

Jeremy White (Cloud Posse) avatar
Jeremy White (Cloud Posse)

can you too? just hop into the build-harness/Makefile and comment out line 42

Jeremy White (Cloud Posse) avatar
Jeremy White (Cloud Posse)

it should be something about including bootstrap files

Cody avatar

I commented out that line, pushed into my repo, ran make all, and still get the infinite loop

Cody avatar
# templates/Makefile.build-harness includes this Makefile
# and this Makefile includes templates/Makefile.build-harness
# to support different modes of invocation. Use a guard variable
# to prevent infinite recursive includes
ifeq ($(BUILD_HARNESS_TOP_LEVEL_MAKEFILE_GUARD),)
BUILD_HARNESS_TOP_LEVEL_MAKEFILE_GUARD := included

export OS ?= $(shell uname -s | tr '[:upper:]' '[:lower:]')
export BUILD_HARNESS_PATH ?= $(shell 'pwd')
export BUILD_HARNESS_EXTENSIONS_PATH ?= $(BUILD_HARNESS_PATH)/../build-harness-extensions
export BUILD_HARNESS_OS ?= $(OS)
export BUILD_HARNESS_ARCH ?= $(shell uname -m | sed 's/x86_64/amd64/g')
export SELF ?= $(MAKE)
export PATH := $(BUILD_HARNESS_PATH)/vendor:$(PATH)
export DOCKER_BUILD_FLAGS ?=

# Forces auto-init off to avoid invoking the macro on recursive $(MAKE)
export BUILD_HARNESS_AUTO_INIT := false

# Debug should not be defaulted to a value because some cli consider any value as `true` (e.g. helm)
export DEBUG ?=

ifeq ($(CURDIR),$(realpath $(BUILD_HARNESS_PATH)))
# Only execute this section if we're actually in the `build-harness` project itself
# List of targets the `readme` target should call before generating the readme
export README_DEPS ?= docs/targets.md auto-label
export DEFAULT_HELP_TARGET = help/all

auto-label: MODULES=$(filter %/, $(sort $(wildcard modules/*/)))
auto-label:
	for module in $(MODULES); do \
		echo "$${module%/}: $${module}**"; \
	done > .github/[email protected]

# builder/build is defined in templates/Makefile.build-harness
build: builder/build

endif

# Import Makefiles into current context
include $(BUILD_HARNESS_PATH)/Makefile.*
#include $(BUILD_HARNESS_PATH)/modules/*/bootstrap.Makefile*
include $(BUILD_HARNESS_PATH)/modules/*/Makefile*
include $(BUILD_HARNESS_PATH)/templates/Makefile.build-harness
# Don't fail if there are no build harness extensions
# Wildcard conditions is to fixes `make[1]: *** No rule to make target` error
ifneq ($(wildcard $(BUILD_HARNESS_EXTENSIONS_PATH)/modules/*/Makefile*),)
-include $(BUILD_HARNESS_EXTENSIONS_PATH)/modules/*/Makefile*
endif

# For backwards compatibility with all of our other projects that use build-harness
init::
	exit 0

ifndef TRANSLATE_COLON_NOTATION
%:
	@$(SELF) -s $(subst :,/,$@) TRANSLATE_COLON_NOTATION=false
endif

endif

Cody avatar

I restored the modules/git/Makefile to original to test again, no difference

Jeremy White (Cloud Posse) avatar
Jeremy White (Cloud Posse)

so, I noticed you said you ‘pushed’ the change. I didn’t have to push. I did the edit directly in the infra folder… since the build-harness directory should be present after running the include lines

Cody avatar

it seems to try to download the .build-harness file everytime

Jeremy White (Cloud Posse) avatar
Jeremy White (Cloud Posse)

oh, not the file

Jeremy White (Cloud Posse) avatar
Jeremy White (Cloud Posse)

the folder

Jeremy White (Cloud Posse) avatar
Jeremy White (Cloud Posse)

there should be a build-harness/Makefile

Cody avatar

oh, you’re running make all in the build-harness project? sorry i was downstream in my own project

Cody avatar

thats why i pushed

Jeremy White (Cloud Posse) avatar
Jeremy White (Cloud Posse)

gotcha. I’m assuming you’re doing a geodesic project, so I have a similar geodesic project

Cody avatar

ok, i was able to run make init in the build-harness project with that line commented out.

Cody avatar

i was not able to run make init while that line is still active

Cody avatar

yeah, we use atmos for managing our terraform projects

Cody avatar

so, geodesic in the background

Jeremy White (Cloud Posse) avatar
Jeremy White (Cloud Posse)

okay, so I think the smoking gun here is the bootstrap.Makefiles

Jeremy White (Cloud Posse) avatar
Jeremy White (Cloud Posse)

and I definitely see the modules/git/bootstrap.Makefile` as being especially suspect…

Cody avatar

fair enough. i am unblocked in my geodesic project by commenting out the line that downloads the build-harness everytime

Cody avatar

at least i can run terraform now

Cody avatar

an extremely large staffing company is white-labelling our software for their own use and i was in the middle of provisioning their infrastructure when everything stopped working

Cody avatar

serious panic set in haha

Cody avatar

i was on the verge of just building my own container and installing atmos

Jeremy White (Cloud Posse) avatar
Jeremy White (Cloud Posse)

gotcha. you don’t have to roll any further with this. I just hoped to unblock you all the same

Cody avatar

thank you very very much for your help, i cant thank you enough!

Cody avatar

if i can help test in any way, i’m happy to do so, you know i face this problem now

Jeremy White (Cloud Posse) avatar
Jeremy White (Cloud Posse)

absolutely, I think once I have a fix in place, I’ll mention the branch, and you should be able to set it in the harness or at least hop into the dir and git checkout

Jeremy White (Cloud Posse) avatar
Jeremy White (Cloud Posse)

if there’s any other way I can help, just holler or add it to the github issue

Jeremy White (Cloud Posse) avatar
Jeremy White (Cloud Posse)

have a good thursday!

Cody avatar

thank you sir! you as well

1

2023-01-11

Jeremy White (Cloud Posse) avatar
Jeremy White (Cloud Posse)
08:34:33 PM

@Jeremy White (Cloud Posse) has joined the channel

2023-01-12

2023-01-23

Release notes from geodesic avatar
Release notes from geodesic
02:50:39 AM

v1.8.0 Update Alpine v3.16.3 -> v3.17.1 Update alpine Docker tag to v3.17.1 @renovate (<a class=”issue-link js-issue-link” data-error-text=”Failed to load title” data-id=”1460754589” data-permission-text=”Title is private” data-url=”https://github.com/cloudposse/geodesic/issues/817“…

Release v1.8.0 Update Alpine v3.16.3 -> v3.17.1 · cloudposse/geodesicattachment image

Update alpine Docker tag to v3.17.1 @renovate (#817) This PR contains the following updates:

Package Type Update Change

alpine final minor 3.16.3 -> 3.17.1

alpine stage minor 3.16.3 -> 3.1…

Update alpine Docker tag to v3.17.1 by renovate[bot] · Pull Request #817 · cloudposse/geodesicattachment image

This PR contains the following updates:

Package Type Update Change

alpine final minor 3.16.3 -> 3.17.1

alpine stage minor 3.16.3 -> 3.17.1

Configuration Schedule: Branch creation - A…

    keyboard_arrow_up