Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document our BOSH release #198

Open
2 tasks done
gcapizzi opened this issue Jul 6, 2021 · 7 comments
Open
2 tasks done

Document our BOSH release #198

gcapizzi opened this issue Jul 6, 2021 · 7 comments

Comments

@gcapizzi
Copy link
Contributor

gcapizzi commented Jul 6, 2021

  • Submodules dependencies in src/gopath
  • Jobs:
    • how do we handle the containerd daemon?
    • what's netplugin-server?
  • Anything interesting in our control scripts that we haven't mentioned yet?
  • How do we implement BPM support?

Tasks

@gcapizzi gcapizzi created this issue from a note in Garden (Scheduled) Jul 6, 2021
@gcapizzi gcapizzi changed the title Document our BOSH release (including BPM) Document our BOSH release Jul 6, 2021
@gcapizzi gcapizzi added the docs label Jul 6, 2021
@gcapizzi gcapizzi added this to the Handover milestone Jul 6, 2021
@ameowlia ameowlia moved this from Done to Un-triaged PRs and Issues in DEPRECATED - WG-Application-Runtime-Platform DEPRECATED Oct 13, 2021
@ameowlia ameowlia removed this from Issue Inbox in DEPRECATED App Platform - Diego Oct 28, 2021
@ameowlia ameowlia removed this from For Review in DEPRECATED App Platform Proposals Oct 28, 2021
@ameowlia ameowlia moved this from Inbox to Issues - Triage Complete. Needs Fix. in DEPRECATED App Platform - Garden Containers Oct 29, 2021
@MarcPaquette
Copy link
Contributor

Howdy @gcapizzi,

Would you like to set up some time to pair in our overlapping hours to go over what we should do to get this closed out?

Thanks,
@MarcPaquette

@MarcPaquette
Copy link
Contributor

Hey @winkingturtle-vmw,
When you get some time I'd like to get this taken care of while we're working on our WG CI Export.
Thanks,
@MarcPaquette

@MarcPaquette
Copy link
Contributor

Some work for this was done with #323

@MarcPaquette
Copy link
Contributor

For Containerd's daemon:

We set up the config file here:

config/containerd.toml.erb: config/containerd.toml

Containerd's config file is built here: https://github.com/cloudfoundry/garden-runc-release/blob/develop/jobs/garden/templates/config/containerd.toml.erb#L29C17-L51

Garden Start starts up the containerd process by calling the method start_containerd:

Which then kicks off the steps to invoke containerd with the previously generated config file:

start_containerd() {
log "starting containerd"
if pidof containerd; then
echo "containerd already running"
return
fi
# migrate the containerd state folder to /var/vcap/sys/run
new_state_dir=/var/vcap/sys/run/containerd/state
old_state_dir=/var/vcap/data/containerd/state
if [ -d "$old_state_dir" ] && [ ! -d "$new_state_dir" ]; then
mkdir -p $(dirname "$new_state_dir")
mv "$old_state_dir" "$new_state_dir"
fi
containerd_config_filepath="$GARDEN_CONFIG_DIR/containerd.toml"
exec_command="exec"
<% if p("garden.experimental_rootless_mode") -%>
maximus=$(/var/vcap/packages/garden-idmapper/bin/maximus)
cp "$GARDEN_CONFIG_DIR/containerd.toml" "$GARDEN_ROOTLESS_CONFIG_DIR"
chown "$maximus:$maximus" "$GARDEN_ROOTLESS_CONFIG_DIR/containerd.toml"
containerd_config_filepath="$GARDEN_ROOTLESS_CONFIG_DIR/containerd.toml"
exec_command="exec execas --uid $maximus --gid $maximus"
<% end -%>
log "running containerd"
$exec_command /var/vcap/packages/containerd/bin/containerd -c "$containerd_config_filepath" \
1>> "${LOG_DIR}/containerd.stdout.log" \
2>> "${LOG_DIR}/containerd.stderr.log" \
&
echo "$!" > "$CONTAINERD_PIDFILE"
address=$(grep containerd.sock $containerd_config_filepath | awk '{print $3}' | tr -d '"')
while ! /var/vcap/packages/containerd/bin/ctr -a $address --connect-timeout 100ms c ls; do
log "waiting for containerd to become available"
sleep 0.1
done
}

Garden's start had previously been acomplished by the configuration of this BPM configuration file: https://github.com/cloudfoundry/garden-runc-release/blob/861e755aed81d437f84f6af709344537578dd6e9/jobs/garden/templates/config/bpm.yml.erb#L1C1-L8C22

@MarcPaquette
Copy link
Contributor

MarcPaquette commented Jan 8, 2024

BPM Support:

Implemented via a couple of flags:
https://github.com/cloudfoundry/garden-runc-release/blob/develop/jobs/garden/spec#L303-L305

https://github.com/cloudfoundry/garden-runc-release/blob/develop/jobs/garden/spec#L157-L159

Some additional Parameters that have caveats when enabling BPM:
https://github.com/cloudfoundry/garden-runc-release/blob/develop/jobs/garden/spec#L157-L159
https://github.com/cloudfoundry/garden-runc-release/blob/develop/jobs/garden/spec#L231-L233

bin/bpm-pre-start.erb: bin/bpm-pre-start

which points to
pre_start: /var/vcap/jobs/garden/bin/bpm-pre-start

<%- if_p('garden.additional_bpm_volumes') { |vols| if vols.include?('/var/vcap/data/rep/shared/garden') -%>

Where we can see where the additional volumes get mounted

start program "/var/vcap/jobs/bpm/bin/bpm start garden"

Which runs (start):

and stop

@MarcPaquette
Copy link
Contributor

MarcPaquette commented Jan 16, 2024

Starting to Look into Netplugin-Shim. Using this comment as a place to take notes.

https://github.com/cloudfoundry/garden-runc-release/wiki/Git-Repositories#netplugin-shim

From: cloudfoundry/cf-deployment@9068ed1
In order to run Garden in BPM containers Garden needs specific network
settings:

  • Diego talks to Garden via a socket
  • Garden talks to a networking server that runs outside the Garden
    container over a dedicated socket
  • The networking server invokes the external networker

@MarcPaquette
Copy link
Contributor

Netplugin-shim is now being removed from garden-runc-release, so the need to document it has evaporated. I'lll work on documenting everything else at this point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Waiting for Changes | Open for Contribution
Garden
Scheduled
DEPRECATED App Platform - Garden Con...
Issues - Triage Complete. Needs Fix.
DEPRECATED - WG-Application-Runtime-P...
Old PRs and Issues (pre-project creat...
Development

No branches or pull requests

3 participants