Skip to content

Commit

Permalink
Merge pull request #1 from canonical/KU-50/cilium-rocks
Browse files Browse the repository at this point in the history
Added cilium agent and cilium operator rocks
  • Loading branch information
addyess authored Jan 16, 2024
2 parents eee5d72 + 4d24b37 commit 3da6ed0
Show file tree
Hide file tree
Showing 2 changed files with 447 additions and 0 deletions.
123 changes: 123 additions & 0 deletions cilium-operator-generic/rockcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: cilium-operator-generic
summary: Cilium operator rock for the Cilium CNI.
description: This rock is a drop in replacement for the cilium/operator-generic image.
version: "1.14.5"
license: Apache-2.0

base: bare
build-base: [email protected]
platforms:
amd64:

environment:
GOPS_CONFIG_DIR: "/"

services:
cilium:
command: /usr/bin/cilium-operator-generic
override: replace
startup: enabled

parts:
builder-img-deps:
plugin: nil
build-packages:
- unzip
- binutils
- coreutils
- curl
- gcc
- git
- libc6-dev
- make

build-deps:
plugin: nil
build-snaps:
- go/1.21/stable
build-packages:
- autoconf
- automake
- autopoint
- autotools-dev
- build-essential
- pkg-config

debug-wrapper:
after: [build-deps, builder-img-deps]
plugin: go
source-type: git
source: https://github.com/cilium/cilium.git
source-tag: v1.14.5
source-subdir: images/builder
build-environment:
- CGO_ENABLED: 0
override-build: |
cd $CRAFT_PART_SRC_WORK
go install github.com/go-delve/delve/cmd/dlv@latest
go install -ldflags "-s -w" debug-wrapper.go
protoc:
plugin: cmake
source-type: git
source: https://github.com/protocolbuffers/protobuf.git
source-tag: v24.0
source-submodules:
- third_party/googletest
- third_party/abseil-cpp
- third_party/jsoncpp
cmake-generator: Ninja
build-packages:
- g++
- git
override-build: |
cmake $CRAFT_PART_SRC -G Ninja \
-DCMAKE_BUILD_TYPE="Release" \
-DCMAKE_INSTALL_PREFIX="$CRAFT_PART_INSTALL/usr/local"
ninja install
stage:
- -usr/local/lib
- -usr/local/include/absl
- -usr/local/include/utf8_range.h
- -usr/local/include/utf8_validity.h

protoplugins:
plugin: go
source: ""
override-build: |
# 8ba23be9613c672d40ae261d2a1335d639bdd59b == tag: cmd/protoc-gen-go-grpc/v1.3.0
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@8ba23be9613c672d40ae261d2a1335d639bdd59b
go install google.golang.org/protobuf/cmd/[email protected]
go install github.com/mitchellh/protoc-gen-go-json@49905733154f04e47d685de62c2cc2b72613b69e
go install github.com/pseudomuto/protoc-gen-doc/cmd/[email protected]
runtime-img-deps:
plugin: nil
stage-packages:
- ca-certificates

gops:
after: [build-deps]
plugin: go
source-type: git
source: https://github.com/google/gops.git
source-tag: v0.3.27
build-environment:
- CGO_ENABLED: 0
override-build: |
go install -ldflags "-s -w" ./...
cilium-operator:
after: [build-deps, builder-img-deps]
plugin: make
source-type: git
source: https://github.com/cilium/cilium.git
source-tag: v1.14.5
override-build: |
export VARIANT="generic"
make build-container-operator-$VARIANT
export DESTDIR=$CRAFT_PART_INSTALL
make install-container-binary-operator-$VARIANT
make licenses-all
cp $CRAFT_PART_BUILD/LICENSE.all $CRAFT_PART_INSTALL/
Loading

0 comments on commit 3da6ed0

Please sign in to comment.