maas/Makefile
Phil Sphicas b648edfe40 Deploy MAAS 2.8 on Ubuntu bionic
Image changes:
* base image ubuntu:18.04
* MAAS version 2.8.6-8602-g.07cdffcaa-0ubuntu1~18.04.1 from ppa/2.8
* default contents of /var/lib/maas are archived in /opt/maas
* updated patches:
  - 2.3_bios_grub_partition.patch, changed in maas [0]
  - 2.3_partitiontable_does_not_exist.patch, changed in maas [1] [2]
  - 2.3_secure_headers.patch, updated for twisted 17.9.0 [3]
* removed patches:
  - 2.3_bios_grub_preseed.patch, changed in maas, now N/A [0]
  - 2.3_hostheader.patch, fixed in maas [4]
  - 2.3_maas_enlist.patch, fixed in maas [5]
  - 2.3_mac_address.patch, fixed in maas [6]
* new patches:
  - 2.8_maas_ipmi_autodetect_tool.patch, enlistment reliability
* reformatted patches due to blackening change [1]:
  - 2.3_configure_ipmi_user.patch
  - 2.3_ipmi_error.patch
  - 2.3_kernel_package.patch, custom req to specify kernel package
  - 2.3_nic_filter.patch, custom req to ignore cali* interfaces
  - 2.3_region_secret_rotate.patch
  - 2.3_route.patch

Chart changes:
* maas-region podport is 5240
* maas config option http_boot is no longer configurable [7]
* start script restores some default files into /var/lib/maas
* register-rack-controller script removes old files in /etc/maas
* enlist userdata now matches commissioning/curtin userdata [8]
* force_gpt option is removed [9], as GPT is now the default
* update to configure remote_syslog in import resources job [10]
* enlist_commissioning is disabled for backwards compatibility [11]

0: d8e234eb09
1: db30bb39fa
2: 665feb7575
3: https://github.com/twisted/twisted/blob/twisted-17.9.0/src/twisted/web/server.py
4: 573da69729
5: d390a1da6a
6: 34631c2fe5
7: 0e94c26a53
8: 22641cffcc
9: 97c25a0486
10: d67c359c7b
11: 51b9712c20

Change-Id: I0685d76cf083ff5aa33c8db552059721289d5c53
2021-08-03 21:56:23 +00:00

114 lines
3.6 KiB
Makefile

# Copyright 2017 AT&T Intellectual Property. All other rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
DOCKER_REGISTRY ?= quay.io
REGION_SUFFIX ?= maas-region
IMG_COMMON_DIR ?= images
REGION_IMG_DIR ?= images/maas-region-controller
RACK_SUFFIX ?= maas-rack
RACK_IMG_DIR ?= images/maas-rack-controller
CACHE_SUFFIX ?= maas-cache
CACHE_IMG_DIR ?= images/sstream-cache
IMAGE_PREFIX ?= airshipit
IMAGE_TAG ?= untagged
PROXY ?= http://proxy.foo.com:8000
NO_PROXY ?= localhost,127.0.0.1,.svc.cluster.local
USE_PROXY ?= false
PUSH_IMAGE ?= false
# use this variable for image labels added in internal build process
LABEL ?= org.airshipit.build=community
COMMIT ?= $(shell git rev-parse HEAD)
IMAGE_NAME := maas-rack-controller maas-region-controller sstream-cache
BUILD_DIR := $(shell mktemp -d)
HELM := $(BUILD_DIR)/helm
SSTREAM_IMAGE := "https://images.maas.io/ephemeral-v3/stable/"
SSTREAM_RELEASE := "bionic"
UBUNTU_BASE_IMAGE ?= ubuntu:18.04
.PHONY: images
#Build all images in the list
images: $(IMAGE_NAME)
$(IMAGE_NAME):
@echo
@echo "===== Processing [$@] image ====="
@make build IMAGE=${DOCKER_REGISTRY}/${IMAGE_PREFIX}/$@:${IMAGE_TAG} IMAGE_DIR=images/$@
# Create tgz of the chart
.PHONY: charts
charts: helm_lint
$(HELM) package build/charts/maas
# Perform Linting
.PHONY: lint
lint: helm_lint
# Dry run templating of chart
.PHONY: dry-run
dry-run: helm_lint
tools/helm_tk.sh $(HELM)
$(HELM) template build/charts/maas
# Make targets intended for use by the primary targets above.
# Install helm binary
.PHONY: helm-install
helm-install:
tools/helm_install.sh $(HELM)
.PHONY: build
build:
ifeq ($(USE_PROXY), true)
docker build -t $(IMAGE) --label $(LABEL) --network=host \
--label "org.opencontainers.image.revision=$(COMMIT)" \
--label "org.opencontainers.image.created=$(shell date --rfc-3339=seconds --utc)" \
--label "org.opencontainers.image.title=$(IMAGE_NAME)" \
-f $(IMAGE_DIR)/Dockerfile \
--build-arg FROM=$(UBUNTU_BASE_IMAGE) \
--build-arg http_proxy=$(PROXY) \
--build-arg https_proxy=$(PROXY) \
--build-arg HTTP_PROXY=$(PROXY) \
--build-arg HTTPS_PROXY=$(PROXY) \
--build-arg no_proxy=$(NO_PROXY) \
--build-arg NO_PROXY=$(NO_PROXY) \
--build-arg SSTREAM_IMAGE=$(SSTREAM_IMAGE) \
--build-arg SSTREAM_RELEASE=$(SSTREAM_RELEASE) \
$(IMAGE_DIR)
else
docker build -t $(IMAGE) --label $(LABEL) --network=host \
--label "org.opencontainers.image.revision=$(COMMIT)" \
--label "org.opencontainers.image.created=$(shell date --rfc-3339=seconds --utc)" \
--label "org.opencontainers.image.title=$(IMAGE_NAME)" \
-f $(IMAGE_DIR)/Dockerfile \
--build-arg FROM=$(UBUNTU_BASE_IMAGE) \
--build-arg SSTREAM_IMAGE=$(SSTREAM_IMAGE) \
--build-arg SSTREAM_RELEASE=$(SSTREAM_RELEASE) \
$(IMAGE_DIR)
endif
ifeq ($(PUSH_IMAGE), true)
docker push $(IMAGE)
endif
.PHONY: clean
clean:
rm -rf build
.PHONY: helm_lint
helm_lint: clean helm-install
tools/helm_tk.sh $(HELM)
mkdir -p build/charts/maas
cp -R charts/maas build/charts/
$(HELM) dep up build/charts/maas
$(HELM) lint build/charts/maas