diff --git a/.github/workflows/pre-merge.yml b/.github/workflows/pre-merge.yml index d8ac5de78..3878d195d 100644 --- a/.github/workflows/pre-merge.yml +++ b/.github/workflows/pre-merge.yml @@ -34,7 +34,7 @@ jobs: id: filter-changes run: | folders_to_remove='[".github",".reuse","LICENSES",".git","os-profiles",""]' - + changed_projects='${{ steps.discover-changes.outputs.changed_projects }}' filtered_projects=$(echo "$changed_projects" | jq -cr --argjson folders_to_remove "$folders_to_remove" 'map(select(. as $item | $folders_to_remove | index($item) | not))') other_changed_projects=$(echo "$changed_projects" | jq -cr --argjson filtered_projects "$filtered_projects" 'map(select(. as $item | $filtered_projects | index($item) | not))') @@ -88,6 +88,7 @@ jobs: run_artifact: false prefix_tag_separator: "/" project_folder: ${{ matrix.project_folder }} + trivy_image_skip: "postgres:16.4" secrets: inherit pre-merge-os-profiles: needs: pre-checks @@ -186,7 +187,7 @@ jobs: run: | pre_merge_pipeline_result="${{ needs.pre-merge-pipeline.result }}" pre_merge_os_profiles_result="${{ needs.pre-merge-os-profiles.result }}" - + echo "Pre-merge pipeline result: $pre_merge_pipeline_result" echo "Pre-merge os-profiles result: $pre_merge_os_profiles_result" diff --git a/Makefile b/Makefile index 4f34f68a8..9dacf8f67 100644 --- a/Makefile +++ b/Makefile @@ -49,6 +49,7 @@ docker-push: ## push all docker containers for dir in $(DOCKER_PROJECTS); do $(MAKE) -C $$dir $@; done docker-list: ## list all docker containers + @echo "images:" @for dir in $(DOCKER_PROJECTS); do $(MAKE) -C $$dir $@; done test: ## test in all subprojects @@ -68,7 +69,7 @@ bit-%: ## Run bulk-import-tools subproject's tasks, e.g. bit-test $(MAKE) -C bulk-import-tools $* einv-%: ## Run exporters-inventory subproject's tasks, e.g. einv-test - $(MAKE) -C exporter-inventory $* + $(MAKE) -C exporters-inventory $* inv-%: ## Run inventory subproject's tasks, e.g. inv-test $(MAKE) -C inventory $* diff --git a/api/Makefile b/api/Makefile index 150375f24..2cae6fa6b 100644 --- a/api/Makefile +++ b/api/Makefile @@ -22,6 +22,7 @@ SWAGGERCLI := true # Project variables PROJECT_NAME := api +PROJECT_NICKNAME := api BINARY_NAME := $(PROJECT_NAME) # Code versions, tags, and so on @@ -31,6 +32,7 @@ VERSION_MAJOR := 0 DOCKER_IMG_NAME := $(PROJECT_NAME) DOCKER_VERSION ?= $(shell git branch --show-current | sed 's/\//_/g') GIT_COMMIT ?= $(shell git rev-parse HEAD) +GIT_TAG_PREFIX := $(PROJECT_NAME)/v # Test variables # Set TEST_TARGET to '' or '' to run specific tests or use other regex '' - example: diff --git a/api/VERSION b/api/VERSION index 7aa332e41..56aa4f42c 100644 --- a/api/VERSION +++ b/api/VERSION @@ -1 +1 @@ -1.33.0 +1.33.1-dev diff --git a/bulk-import-tools/Makefile b/bulk-import-tools/Makefile index 9bcf5e2cb..7aa9d6c46 100644 --- a/bulk-import-tools/Makefile +++ b/bulk-import-tools/Makefile @@ -19,12 +19,14 @@ PROTOCGENDOC := true # Project variables PROJECT_NAME := bulk-import-tools +PROJECT_NICKNAME := bit BULK_IMPORT_BINARY_NAME := orch-host-bulk-import PREFLIGHT_BINARY_NAME := orch-host-preflight # Versioning variables -VERSION := $(shell cat VERSION) -GIT_COMMIT ?= $(shell git rev-parse --short HEAD) +VERSION := $(shell cat VERSION) +GIT_COMMIT ?= $(shell git rev-parse --short HEAD) +GIT_TAG_PREFIX := $(PROJECT_NAME)/v # Test variables # Set TEST_TARGET to '' or '' to run specific tests or use regex '' - example: diff --git a/common.mk b/common.mk index a445de2cd..922b6ebc9 100644 --- a/common.mk +++ b/common.mk @@ -34,11 +34,12 @@ DEPS := go.mod go.sum # Docker variables DOCKER_ENV := DOCKER_BUILDKIT=1 OCI_REGISTRY ?= 080137407410.dkr.ecr.us-west-2.amazonaws.com -OCI_REPOSITORY ?= edge-orch/infra +OCI_REPOSITORY ?= edge-orch +DOCKER_SECTION := infra DOCKER_REGISTRY ?= $(OCI_REGISTRY) DOCKER_REPOSITORY ?= $(OCI_REPOSITORY) -DOCKER_TAG := $(DOCKER_REGISTRY)/$(DOCKER_REPOSITORY)/$(DOCKER_IMG_NAME):$(VERSION) -DOCKER_TAG_BRANCH := $(DOCKER_REGISTRY)/$(DOCKER_REPOSITORY)/$(DOCKER_IMG_NAME):$(DOCKER_VERSION) +DOCKER_TAG := $(DOCKER_REGISTRY)/$(DOCKER_REPOSITORY)/$(DOCKER_SECTION)/$(DOCKER_IMG_NAME):$(VERSION) +DOCKER_TAG_BRANCH := $(DOCKER_REGISTRY)/$(DOCKER_REPOSITORY)/$(DOCKER_SECTION)/$(DOCKER_IMG_NAME):$(DOCKER_VERSION) # Decides if we shall push image tagged with the branch name or not. DOCKER_TAG_BRANCH_PUSH ?= true LABEL_REPO_URL ?= $(shell git remote get-url $(shell git remote | head -n 1)) @@ -46,11 +47,11 @@ LABEL_VERSION ?= $(VERSION) LABEL_REVISION ?= $(GIT_COMMIT) LABEL_BUILD_DATE ?= $(shell date -u "+%Y-%m-%dT%H:%M:%SZ") -DB_CONTAINER_NAME := $(PROJECT_NAME)-db +DB_CONTAINER_NAME := $(PROJECT_NAME)-db YAML_FILES := $(shell find . -type f \( -name '*.yaml' -o -name '*.yml' \) -print ) YAML_IGNORE ?= vendor, .github/workflows, $(VENV_NAME) -YAML_LINE_LENGHT ?= 99 +YAML_LINE_LENGTH ?= 99 # Docker networking flags for the database container. # The problem is as follows: On a local MacOS machine we want to expose the port @@ -106,7 +107,7 @@ common-docker-build: ## Build Docker image $(GOCMD) mod vendor cp ../common.mk ../version.mk . docker build . -f Dockerfile \ - -t $(DOCKER_IMG_NAME):$(DOCKER_VERSION) \ + -t $(DOCKER_IMG_NAME):$(VERSION) \ --build-arg http_proxy="$(http_proxy)" --build-arg HTTP_PROXY="$(HTTP_PROXY)" \ --build-arg https_proxy="$(https_proxy)" --build-arg HTTPS_PROXY="$(HTTPS_PROXY)" \ --build-arg no_proxy="$(no_proxy)" --build-arg NO_PROXY="$(NO_PROXY)" \ @@ -119,15 +120,19 @@ common-docker-build: ## Build Docker image common-docker-push: ## Tag and push Docker image # TODO: remove ecr create aws ecr create-repository --region us-west-2 --repository-name $(DOCKER_REPOSITORY)/$(DOCKER_IMG_NAME) || true - docker tag $(DOCKER_IMG_NAME):$(DOCKER_VERSION) $(DOCKER_TAG_BRANCH) - docker tag $(DOCKER_IMG_NAME):$(DOCKER_VERSION) $(DOCKER_TAG) + docker tag $(DOCKER_IMG_NAME):$(VERSION) $(DOCKER_TAG_BRANCH) + docker tag $(DOCKER_IMG_NAME):$(VERSION) $(DOCKER_TAG) docker push $(DOCKER_TAG) ifeq ($(DOCKER_TAG_BRANCH_PUSH), true) docker push $(DOCKER_TAG_BRANCH) endif docker-list: ## Print name of docker container image - @echo $(DOCKER_TAG) + @echo " $(DOCKER_IMG_NAME):" + @echo " name: '$(DOCKER_TAG)'" + @echo " version: '$(VERSION)'" + @echo " gitTagPrefix: '$(GIT_TAG_PREFIX)'" + @echo " buildTarget: '$(PROJECT_NICKNAME)-docker-build'" #### Python venv Target #### @@ -169,10 +174,12 @@ checksec: go-build ## Check various security properties that are available for e checksec --output=json --file=$(OUT_DIR)/$(BINARY_NAME) checksec --fortify-file=$(OUT_DIR)/$(BINARY_NAME) +YAML_FILES := $(shell find . -type f \( -name '*.yaml' -o -name '*.yml' \) -print ) +YAML_IGNORE ?= vendor, .github/workflows, $(VENV_NAME) yamllint: $(VENV_NAME) ## Lint YAML files . ./$' or '' to run specific tests or use regex '' - example: diff --git a/exporters-inventory/VERSION b/exporters-inventory/VERSION index ec6d649be..e5c430a25 100644 --- a/exporters-inventory/VERSION +++ b/exporters-inventory/VERSION @@ -1 +1 @@ -1.18.1 +1.18.2-dev diff --git a/inventory/Makefile b/inventory/Makefile index cf22f8ea4..6603e8e3f 100644 --- a/inventory/Makefile +++ b/inventory/Makefile @@ -27,6 +27,7 @@ PROTOCGENGOGRPC := true # Project variables PROJECT_NAME := inventory +PROJECT_NICKNAME := inv BINARY_NAME := $(PROJECT_NAME) # Code versions, tags, and so on @@ -35,6 +36,7 @@ VERSION_MAJOR := $(shell cut -c 1 VERSION) DOCKER_IMG_NAME := $(PROJECT_NAME) DOCKER_VERSION ?= $(shell git branch --show-current | sed 's/\//_/g') GIT_COMMIT ?= $(shell git rev-parse HEAD) +GIT_TAG_PREFIX := $(PROJECT_NAME)/v # Test variables # Set TEST_TARGET to '' or '' to run specific tests or use other regex '' - example: diff --git a/inventory/VERSION b/inventory/VERSION index 62eccae33..a5ed6a8ca 100644 --- a/inventory/VERSION +++ b/inventory/VERSION @@ -1 +1 @@ -2.23.1 +2.23.2-dev diff --git a/os-profiles/Makefile b/os-profiles/Makefile index 0fa2549e0..1c510fb9d 100644 --- a/os-profiles/Makefile +++ b/os-profiles/Makefile @@ -27,7 +27,7 @@ ALL_PROFILES := $(shell find *.yaml) include ../common.mk # Lint variables -YAML_LINE_LENGHT := 150 +YAML_LINE_LENGTH := 150 OCI_REPOSITORY := edge-orch/en/files/os-profile diff --git a/os-profiles/VERSION b/os-profiles/VERSION index 53a75d673..4af1d5b38 100644 --- a/os-profiles/VERSION +++ b/os-profiles/VERSION @@ -1 +1 @@ -0.2.6 +0.2.7-dev diff --git a/os-profiles/template/profile-template.yaml b/os-profiles/template/profile-template.yaml index efa15d498..b3bd2ba76 100644 --- a/os-profiles/template/profile-template.yaml +++ b/os-profiles/template/profile-template.yaml @@ -9,7 +9,8 @@ spec: # human-readable name of OS profile name: # OS_TYPE_IMMUTABLE or OS_TYPE_MUTABLE, - # should match values in https://github.com/open-edge-platform/infra-core/blob/main/inventory/api/os/v1/os.proto#L25-L29 + # should match values in + # https://github.com/open-edge-platform/infra-core/blob/main/inventory/api/os/v1/os.proto#L25-L29 type: # must be unique across all files under manifest/en-profile profileName: @@ -20,7 +21,8 @@ spec: # SHA256 checksum for integrity check osImageSha256: # security settings for OS profile, - # should match values in https://github.com/open-edge-platform/infra-core/blob/main/inventory/api/os/v1/os.proto#L18-L22 + # should match values in + # https://github.com/open-edge-platform/infra-core/blob/main/inventory/api/os/v1/os.proto#L18-L22 securityFeature: platformBundle: installerScript: # URL of the installer script part of the platform bundle diff --git a/os-profiles/ubuntu-22.04-lts-generic-ext.yaml b/os-profiles/ubuntu-22.04-lts-generic-ext.yaml index 86f3756f9..23d9b5ae3 100644 --- a/os-profiles/ubuntu-22.04-lts-generic-ext.yaml +++ b/os-profiles/ubuntu-22.04-lts-generic-ext.yaml @@ -11,7 +11,8 @@ spec: provider: OS_PROVIDER_KIND_INFRA architecture: x86_64 profileName: ubuntu-22.04-lts-generic-ext - osImageUrl: https://cloud-images.ubuntu.com/releases/22.04/release-20250228/ubuntu-22.04-server-cloudimg-amd64.img + osImageUrl: >- + https://cloud-images.ubuntu.com/releases/22.04/release-20250228/ubuntu-22.04-server-cloudimg-amd64.img osImageVersion: 22.04.5 osImageSha256: b9b65a7e045ca262ad614cbedeaa1bf34b9325d76f856e85e17b68984e7a4314 osPackageManifestURL: "" diff --git a/os-profiles/ubuntu-22.04-lts-generic.yaml b/os-profiles/ubuntu-22.04-lts-generic.yaml index a6ef56e05..247b6699b 100644 --- a/os-profiles/ubuntu-22.04-lts-generic.yaml +++ b/os-profiles/ubuntu-22.04-lts-generic.yaml @@ -11,7 +11,8 @@ spec: provider: OS_PROVIDER_KIND_INFRA architecture: x86_64 profileName: ubuntu-22.04-lts-generic - osImageUrl: https://cloud-images.ubuntu.com/releases/22.04/release-20250228/ubuntu-22.04-server-cloudimg-amd64.img + osImageUrl: >- + https://cloud-images.ubuntu.com/releases/22.04/release-20250228/ubuntu-22.04-server-cloudimg-amd64.img osImageVersion: 22.04.5 osImageSha256: b9b65a7e045ca262ad614cbedeaa1bf34b9325d76f856e85e17b68984e7a4314 osPackageManifestURL: "" diff --git a/tenant-controller/Makefile b/tenant-controller/Makefile index 12ad00a82..911d86768 100644 --- a/tenant-controller/Makefile +++ b/tenant-controller/Makefile @@ -19,8 +19,9 @@ OPA := true PROTOCGENENT := true # Project variables -PROJECT_NAME := tenant-controller -BINARY_NAME := $(PROJECT_NAME) +PROJECT_NAME := tenant-controller +PROJECT_NICKNAME := tc +BINARY_NAME := $(PROJECT_NAME) # Versioning variables VERSION := $(shell cat VERSION) @@ -28,6 +29,7 @@ VERSION_MAJOR := $(shell cut -c 1 VERSION) DOCKER_IMG_NAME := $(PROJECT_NAME) DOCKER_VERSION ?= $(shell git branch --show-current | sed 's/\//_/g') GIT_COMMIT ?= $(shell git rev-parse HEAD) +GIT_TAG_PREFIX := $(PROJECT_NAME)/v # Test variables # Set TEST_TARGET to '' or '' to run specific tests or use regex '' - example: @@ -66,7 +68,7 @@ buf-lint: common-buf-lint ## Lint and format protobuf files #### Development Targets #### build: go-build ## Build local binaries - + lint: $(OUT_DIR) license yamllint hadolint go-lint mdlint ## Run all lint tools test: $(OUT_DIR) go-test ## Run all unit tests