mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-11-07 04:36:52 -10:00
release: remove Oracle Cloud Infrastructure build targets
Oracle's previous support is no longer available to the project. Repeated attempts to find a sponsor within Oracle's cloud business have not been successful. The last published official images are from 15.0-RELEASE. https://marketplace.oracle.com/app/freebsd-release Relnotes: yes Sponsored by: SkunkWerks, GmbH Differential Revision: https://reviews.freebsd.org/D56360 MFC after: 3 days
This commit is contained in:
1 parent
58de791536
commit
3b10806812
9 files changed
+1
-435
No files matched your search
@@ -1,108 +0,0 @@
|
||||
#
|
||||
# Makefile for preparing & uploading Oracle Cloud images from existing
|
||||
# .raw files created by cloudware-release.
|
||||
#
|
||||
# Overview:
|
||||
#
|
||||
# The base image is already created by cloudware-release.
|
||||
#
|
||||
# Construct the custom OCI metadata, derived from exported official OCI images.
|
||||
# It is architecture-specific but appears mostly stable over time.
|
||||
# Compress the raw image and place it in the same directory as the metadata.
|
||||
# Make a GNU format tarball of these files.
|
||||
# Upload the tarball to Oracle Cloud via a pre-approved curl URI, into
|
||||
# the FreeBSD Foundation's Oracle Cloud account.
|
||||
#
|
||||
# These images go into the "re" bucket in us-ashburn-1 region, which
|
||||
# is mounted into the FreeBSD Foundation Oracle Marketplace account.
|
||||
# Once uploaded, a manual step is needed to import the images as local
|
||||
# custom images. These can then be tested within the us-ashburn-1 region.
|
||||
# Once tested, follow the manual Oracle Marketplace import process to
|
||||
# create a new FreeBSD version, attach the images, and initiate validation
|
||||
# by Oracle. This can take up to 5 working days. Once complete, a final
|
||||
# manual step is needed to mark the currently private images, public.
|
||||
# Syncing to all sites should take 2-3 hours after this final step.
|
||||
|
||||
ORACLE_BASENAME= ${OSRELEASE}-${BUILDDATE}${GITREV:C/^(.+)/-\1/}
|
||||
CLEANFILES+= cw-oracle-portinstall
|
||||
|
||||
cw-oracle-portinstall: .PHONY
|
||||
.if (!exists(/usr/local/bin/curl) || !exists(/usr/local/bin/qemu-img)) && !exists(${PORTSDIR}/Makefile)
|
||||
. if !exists(/usr/local/sbin/pkg-static)
|
||||
env ASSUME_ALWAYS_YES=yes pkg bootstrap -yf
|
||||
. endif
|
||||
.endif
|
||||
.if !exists(/usr/local/bin/curl)
|
||||
. if !exists(${PORTSDIR}/Makefile)
|
||||
env ASSUME_ALWAYS_YES=yes pkg install -y ftp/curl
|
||||
. else
|
||||
env UNAME_r=${UNAME_r} make -C \
|
||||
${PORTSDIR}/ftp/curl \
|
||||
BATCH=1 WRKDIRPREFIX=/tmp/ports DISTDIR=/tmp/distfiles \
|
||||
all install clean
|
||||
. endif
|
||||
.endif
|
||||
.if !exists(/usr/local/bin/qemu-img)
|
||||
. if !exists(${PORTSDIR}/Makefile)
|
||||
env ASSUME_ALWAYS_YES=yes pkg install -y emulators/qemu@tools
|
||||
. else
|
||||
env UNAME_r=${UNAME_r} FLAVOR=tools make -C \
|
||||
${PORTSDIR}/emulators/qemu \
|
||||
BATCH=1 WRKDIRPREFIX=/tmp/ports DISTDIR=/tmp/distfiles \
|
||||
all install clean
|
||||
. endif
|
||||
.endif
|
||||
|
||||
.for _FS in ${ORACLE_FSLIST}
|
||||
ORACLE_OCI_LIST+= cw-oracle-${_FS}.oci
|
||||
ORACLE_UPLOAD_LIST+= cw-oracle-upload-${_FS}
|
||||
CLEANFILES+= cw-oracle-${_FS}.oci
|
||||
ORACLE_TMP_${_FS}= cw-oracle-${_FS}.oci.tmpdir
|
||||
CLEANDIRS+= ${ORACLE_TMP_${_FS}}
|
||||
ORACLE_METADATA= ${.CURDIR}/scripts/oracle
|
||||
ORACLE_CAPABILITY= ${.CURDIR}/scripts/oracle/image_capability_data.json
|
||||
ORACLE_TEMPLATE= ${.CURDIR}/scripts/oracle/image_metadata.json
|
||||
ORACLE_OUTPUT_${_FS}= ${ORACLE_TMP_${_FS}}/image_metadata.json
|
||||
.if ${TARGET} == "arm64"
|
||||
ORACLE_SHAPES= ${ORACLE_METADATA}/arm64_shape_compatibilities.json
|
||||
.else
|
||||
ORACLE_SHAPES= ${ORACLE_METADATA}/default_shape_compatibilities.json
|
||||
.endif
|
||||
|
||||
cw-oracle-${_FS}.oci: cw-oracle-portinstall cw-oracle-${_FS}-raw
|
||||
mkdir -p ${ORACLE_TMP_${_FS}}
|
||||
# create architecture-specific JSON metadata
|
||||
env TYPE="${TYPE}" \
|
||||
OSRELEASE="${OSRELEASE}" \
|
||||
ORACLE_CAPABILITY="${ORACLE_CAPABILITY}" \
|
||||
ORACLE_SHAPES="${ORACLE_SHAPES}" \
|
||||
ORACLE_TEMPLATE="${ORACLE_TEMPLATE}" \
|
||||
ORACLE_OUTPUT="${ORACLE_OUTPUT_${_FS}}" \
|
||||
${ORACLE_METADATA}/generate_metadata.lua
|
||||
|
||||
# convert raw to native qcow2 for zstd compression, saves ~ 8GiB
|
||||
qemu-img convert -S 512b -p -O qcow2 -c -o compression_type=zstd \
|
||||
${.OBJDIR}/${ORACLE${_FS:tu}RAWIMAGE} \
|
||||
${ORACLE_TMP_${_FS}}/output.QCOW2
|
||||
|
||||
# Create GNU-compatible tarball using BSD tar
|
||||
tar --format=gnutar -cf ${.TARGET} -C ${ORACLE_TMP_${_FS}} \
|
||||
image_metadata.json output.QCOW2
|
||||
|
||||
echo "Oracle image ${.TARGET} is ready for upload."
|
||||
|
||||
cw-oracle-upload-${_FS}: cw-oracle-${_FS}.oci
|
||||
.if !defined(ORACLE_PAR_URL) || empty(ORACLE_PAR_URL)
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo ">>> ORACLE_PAR_URL must be set for Oracle image upload"
|
||||
@echo ">>> for testing, use a file:/// URL to a local directory"
|
||||
@echo "--------------------------------------------------------------"
|
||||
@false
|
||||
.endif
|
||||
echo "Please wait ... uploading cw-oracle-${_FS}.oci to ${ORACLE_BASENAME}-${_FS}.oci"
|
||||
curl -s ${ORACLE_PAR_URL}/${ORACLE_BASENAME}-${_FS}.oci --upload-file cw-oracle-${_FS}.oci
|
||||
echo "Uploaded cw-oracle-${_FS}.oci as ${ORACLE_BASENAME}-${_FS}.oci"
|
||||
touch ${.TARGET}
|
||||
.endfor
|
||||
|
||||
cw-oracle-upload: cw-oracle-portinstall ${ORACLE_UPLOAD_LIST}
|
||||
@@ -24,7 +24,6 @@ CLOUDWARE_TYPES?= AZURE \
|
||||
BASIC-CLOUDINIT \
|
||||
EC2 \
|
||||
GCE \
|
||||
ORACLE \
|
||||
VAGRANT
|
||||
AZURE_FORMAT= vhdf
|
||||
AZURE_FSLIST?= ufs zfs
|
||||
@@ -45,9 +44,6 @@ EC2-SMALL_DESC= Amazon EC2 small image
|
||||
GCE_FORMAT= raw
|
||||
GCE_FSLIST?= ufs zfs
|
||||
GCE_DESC= Google Compute Engine image
|
||||
ORACLE_FORMAT= raw
|
||||
ORACLE_FSLIST?= ufs zfs
|
||||
ORACLE_DESC= Oracle Cloud Infrastructure image
|
||||
OPENSTACK_FORMAT=qcow2
|
||||
OPENSTACK_FSLIST?= ufs
|
||||
OPENSTACK_DESC= OpenStack platform image
|
||||
@@ -315,6 +311,5 @@ cloudware-release:
|
||||
.include "${.CURDIR}/Makefile.ec2"
|
||||
.include "${.CURDIR}/Makefile.firecracker"
|
||||
.include "${.CURDIR}/Makefile.gce"
|
||||
.include "${.CURDIR}/Makefile.oracle"
|
||||
.include "${.CURDIR}/Makefile.vagrant"
|
||||
.include "${.CURDIR}/Makefile.inc1"
|
||||
@@ -113,7 +113,7 @@ PORTBRANCH="main"
|
||||
|
||||
## If WITH_CLOUDWARE is set to a non-empty value, this is a list of providers
|
||||
## to create disk images.
|
||||
#CLOUDWARE="EC2 GCE ORACLE VAGRANT-VIRTUALBOX VAGRANT-VMWARE"
|
||||
#CLOUDWARE="EC2 GCE VAGRANT-VIRTUALBOX VAGRANT-VMWARE"
|
||||
|
||||
## If WITH_OCIIMAGES is set to a non-empty value, build Open Container
|
||||
## Initiative (OCI) base images as part of the release.
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
[
|
||||
{
|
||||
"internalShapeName": "VM.Standard.A1.Flex",
|
||||
"ocpuConstraints": {
|
||||
"min": 1,
|
||||
"max": 80
|
||||
},
|
||||
"memoryConstraints": {
|
||||
"minInGBs": 1,
|
||||
"maxInGBs": 512
|
||||
}
|
||||
},
|
||||
{
|
||||
"internalShapeName": "VM.Standard.A2.Flex",
|
||||
"ocpuConstraints": {
|
||||
"min": 1,
|
||||
"max": 78
|
||||
},
|
||||
"memoryConstraints": {
|
||||
"minInGBs": 1,
|
||||
"maxInGBs": 946
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -1 +0,0 @@
|
||||
[]
|
||||
@@ -1,74 +0,0 @@
|
||||
#!/usr/libexec/flua
|
||||
|
||||
local ucl = require("ucl")
|
||||
|
||||
-- read from environment variables
|
||||
local os_type = os.getenv("TYPE")
|
||||
local os_version = os.getenv("OSRELEASE")
|
||||
-- the raw file
|
||||
local capability_file = os.getenv("ORACLE_CAPABILITY")
|
||||
-- the platform-specific file
|
||||
local shapes_file = os.getenv("ORACLE_SHAPES")
|
||||
-- base template
|
||||
local template_file = os.getenv("ORACLE_TEMPLATE")
|
||||
local output_file = os.getenv("ORACLE_OUTPUT")
|
||||
|
||||
if not os_type or not os_version or not capability_file or
|
||||
not shapes_file or not template_file or not output_file then
|
||||
io.stderr:write("Error: Oracle metadata script is missing required environment variables:\n")
|
||||
io.stderr:write("TYPE, OSRELEASE, ORACLE_CAPABILITY, ORACLE_SHAPES, ORACLE_TEMPLATE, ORACLE_OUTPUT\n")
|
||||
os.exit(1)
|
||||
end
|
||||
|
||||
-- read files
|
||||
local function read_file(path)
|
||||
local f = io.open(path, "r")
|
||||
if not f then
|
||||
io.stderr:write("Error: Oracle metadata script cannot open file: " .. path .. "\n")
|
||||
os.exit(1)
|
||||
end
|
||||
local content = f:read("*a")
|
||||
f:close()
|
||||
return content
|
||||
end
|
||||
|
||||
-- parse the template
|
||||
local template = read_file(template_file)
|
||||
local metadata = ucl.parser()
|
||||
metadata:parse_string(template)
|
||||
local data = metadata:get_object()
|
||||
|
||||
-- update the simple fields
|
||||
data.operatingSystem = os_type
|
||||
data.operatingSystemVersion = os_version
|
||||
|
||||
-- capability data is actually JSON, but needs to be inserted as a raw blob
|
||||
local caps = read_file(capability_file)
|
||||
-- remove all newlines and preceding spaces to match Oracle's format
|
||||
caps = caps:gsub("\n", "")
|
||||
caps = caps:gsub("%s+", "")
|
||||
-- is it still valid JSON?
|
||||
local caps_parser = ucl.parser()
|
||||
if not caps_parser:parse_string(caps) then
|
||||
io.stderr:write("Error: Oracle metadata script found invalid JSON in capability file\n")
|
||||
os.exit(1)
|
||||
end
|
||||
-- insert as a raw blob
|
||||
data.imageCapabilityData = caps
|
||||
|
||||
-- parse and insert architecture-dependent shape compatibilities data
|
||||
local shapes_data = read_file(shapes_file)
|
||||
local shapes = ucl.parser()
|
||||
shapes:parse_string(shapes_data)
|
||||
data.additionalMetadata.shapeCompatibilities = shapes:get_object()
|
||||
|
||||
-- save the metadata file
|
||||
local dir = os.getenv("PWD")
|
||||
local out = io.open(output_file, "w")
|
||||
if not out then
|
||||
io.stderr:write("Error: Oracle metadata script cannot create output file: "
|
||||
.. dir .. "/" .. output_file .. "\n")
|
||||
os.exit(1)
|
||||
end
|
||||
out:write(ucl.to_format(data, "json", {pretty = true}))
|
||||
out:close()
|
||||
@@ -1,96 +0,0 @@
|
||||
{
|
||||
"capabilities": {
|
||||
"Compute.AMD_SecureEncryptedVirtualization": {
|
||||
"descriptorType": "boolean",
|
||||
"defaultValue": false
|
||||
},
|
||||
"Storage.BootVolumeType": {
|
||||
"descriptorType": "enumstring",
|
||||
"values": [
|
||||
"ISCSI",
|
||||
"PARAVIRTUALIZED",
|
||||
"SCSI",
|
||||
"IDE",
|
||||
"NVME"
|
||||
],
|
||||
"defaultValue": "PARAVIRTUALIZED"
|
||||
},
|
||||
"Storage.Iscsi.MultipathDeviceSupported": {
|
||||
"descriptorType": "boolean",
|
||||
"defaultValue": false
|
||||
},
|
||||
"Storage.ParaVirtualization.EncryptionInTransit": {
|
||||
"descriptorType": "boolean",
|
||||
"defaultValue": true
|
||||
},
|
||||
"Storage.ConsistentVolumeNaming": {
|
||||
"descriptorType": "boolean",
|
||||
"defaultValue": true
|
||||
},
|
||||
"Compute.SecureBoot": {
|
||||
"descriptorType": "boolean",
|
||||
"defaultValue": false
|
||||
},
|
||||
"Storage.ParaVirtualization.AttachmentVersion": {
|
||||
"descriptorType": "enuminteger",
|
||||
"values": [
|
||||
1,
|
||||
2
|
||||
],
|
||||
"defaultValue": 2
|
||||
},
|
||||
"Storage.LocalDataVolumeType": {
|
||||
"descriptorType": "enumstring",
|
||||
"values": [
|
||||
"ISCSI",
|
||||
"PARAVIRTUALIZED",
|
||||
"SCSI",
|
||||
"IDE",
|
||||
"NVME"
|
||||
],
|
||||
"defaultValue": "PARAVIRTUALIZED"
|
||||
},
|
||||
"Network.AttachmentType": {
|
||||
"descriptorType": "enumstring",
|
||||
"values": [
|
||||
"PARAVIRTUALIZED",
|
||||
"VDPA"
|
||||
],
|
||||
"defaultValue": "PARAVIRTUALIZED"
|
||||
},
|
||||
"Storage.RemoteDataVolumeType": {
|
||||
"descriptorType": "enumstring",
|
||||
"values": [
|
||||
"ISCSI",
|
||||
"PARAVIRTUALIZED",
|
||||
"SCSI",
|
||||
"IDE",
|
||||
"NVME"
|
||||
],
|
||||
"defaultValue": "PARAVIRTUALIZED"
|
||||
},
|
||||
"Compute.LaunchMode": {
|
||||
"descriptorType": "enumstring",
|
||||
"values": [
|
||||
"NATIVE",
|
||||
"EMULATED",
|
||||
"VDPA",
|
||||
"PARAVIRTUALIZED",
|
||||
"CUSTOM"
|
||||
],
|
||||
"defaultValue": "PARAVIRTUALIZED"
|
||||
},
|
||||
"Network.IPv6Only": {
|
||||
"descriptorType": "boolean",
|
||||
"defaultValue": false
|
||||
},
|
||||
"Compute.Firmware": {
|
||||
"descriptorType": "enumstring",
|
||||
"values": [
|
||||
"BIOS",
|
||||
"UEFI_64"
|
||||
],
|
||||
"defaultValue": "UEFI_64"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
{
|
||||
"version": 2,
|
||||
"externalLaunchOptions": {
|
||||
"firmware": "UEFI_64",
|
||||
"networkType": "PARAVIRTUALIZED",
|
||||
"bootVolumeType": "PARAVIRTUALIZED",
|
||||
"remoteDataVolumeType": "PARAVIRTUALIZED",
|
||||
"localDataVolumeType": "PARAVIRTUALIZED",
|
||||
"launchOptionsSource": "PARAVIRTUALIZED",
|
||||
"pvAttachmentVersion": 2,
|
||||
"pvEncryptionInTransitEnabled": false,
|
||||
"consistentVolumeNamingEnabled": false
|
||||
},
|
||||
"imageCapabilityData": "REPLACE",
|
||||
"imageCapsFormatVersion": "23cfd738-ad9c-4f56-9281-67be6c8cd14c",
|
||||
"operatingSystem": "REPLACE",
|
||||
"operatingSystemVersion": "REPLACE",
|
||||
"additionalMetadata": {
|
||||
"shapeCompatibilities": "REPLACE"
|
||||
}
|
||||
}
|
||||
@@ -1,105 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Set to a list of packages to install.
|
||||
export VM_EXTRA_PACKAGES="
|
||||
comms/py-pyserial
|
||||
converters/base64
|
||||
devel/oci-cli
|
||||
devel/py-babel
|
||||
devel/py-iso8601
|
||||
devel/py-pbr
|
||||
devel/py-six
|
||||
ftp/curl
|
||||
lang/python
|
||||
lang/python3
|
||||
net/cloud-init
|
||||
net/py-eventlet
|
||||
net/py-netaddr
|
||||
net/py-netifaces
|
||||
net/py-oauth
|
||||
net/rsync
|
||||
security/ca_root_nss
|
||||
security/sudo@default
|
||||
sysutils/firstboot-freebsd-update
|
||||
sysutils/firstboot-pkgs
|
||||
sysutils/panicmail
|
||||
textproc/jq
|
||||
"
|
||||
|
||||
# Should be enough for base image, image can be resized in needed
|
||||
export VMSIZE=8g
|
||||
|
||||
# Set to a list of third-party software to enable in rc.conf(5).
|
||||
export VM_RC_LIST="
|
||||
cloudinit
|
||||
firstboot_pkgs
|
||||
firstboot_freebsd_update
|
||||
growfs
|
||||
ntpd
|
||||
ntpd_sync_on_start
|
||||
sshd
|
||||
zfs"
|
||||
|
||||
# Hack for FreeBSD 15.0; should go away before 15.1.
|
||||
MISSING_METALOGS="
|
||||
./usr/local/etc/cloud/cloud.cfg
|
||||
./usr/local/etc/cloud/cloud.cfg.d/05_logging.cfg
|
||||
./usr/local/etc/cloud/cloud.cfg.d/99_freebsd.cfg
|
||||
./usr/local/etc/pam.d/sudo
|
||||
./usr/local/etc/rsync/rsyncd.conf
|
||||
./usr/local/etc/ssl/cert.pem
|
||||
./usr/local/etc/sudo.conf
|
||||
./usr/local/etc/sudo_logsrvd.conf
|
||||
./usr/local/etc/sudoers
|
||||
"
|
||||
|
||||
vm_extra_pre_umount() {
|
||||
cat <<-'EOF' >> ${DESTDIR}/etc/rc.conf
|
||||
dumpdev=AUTO
|
||||
EOF
|
||||
|
||||
cat <<-'EOF' >> ${DESTDIR}/boot/loader.conf
|
||||
autoboot_delay="5"
|
||||
beastie_disable="YES"
|
||||
boot_serial="YES"
|
||||
loader_logo="none"
|
||||
cryptodev_load="YES"
|
||||
opensolaris_load="YES"
|
||||
xz_load="YES"
|
||||
zfs_load="YES"
|
||||
EOF
|
||||
metalog_add_data ./boot/loader.conf
|
||||
|
||||
cat <<-'EOF' >> ${DESTDIR}/etc/ssh/sshd_config
|
||||
# S11 Configure the SSH service to prevent password-based login
|
||||
PermitRootLogin prohibit-password
|
||||
PasswordAuthentication no
|
||||
KbdInteractiveAuthentication no
|
||||
PermitEmptyPasswords no
|
||||
UseDNS no
|
||||
EOF
|
||||
|
||||
# S14 Root user login must be disabled on serial-over-ssh console
|
||||
pw -R ${DESTDIR} usermod root -w no
|
||||
# Oracle requirements override the default FreeBSD cloud-init settings
|
||||
cat <<-'EOF' >> ${DESTDIR}/usr/local/etc/cloud/cloud.cfg.d/98_oracle.cfg
|
||||
disable_root: true
|
||||
system_info:
|
||||
distro: freebsd
|
||||
default_user:
|
||||
name: freebsd
|
||||
lock_passwd: True
|
||||
gecos: "Oracle Cloud Default User"
|
||||
groups: [wheel]
|
||||
sudo: ["ALL=(ALL) NOPASSWD:ALL"]
|
||||
shell: /bin/sh
|
||||
network:
|
||||
renderers: ['freebsd']
|
||||
EOF
|
||||
metalog_add_data ./usr/local/etc/cloud/cloud.cfg.d/98_oracle.cfg
|
||||
|
||||
# Use Oracle Cloud Infrastructure NTP server
|
||||
sed -i '' -E -e 's/^pool.*iburst/server 169.254.169.254 iburst/' \
|
||||
${DESTDIR}/etc/ntp.conf
|
||||
|
||||
return 0
|
||||
}
|
||||
Reference in new issue
Block a user