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

Merge dev to master #232

Merged
merged 35 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
2e659e1
Removed devicedb daemon and configuration
mray190 Jul 15, 2021
2d239bd
Match rpm maestro configuration to debian maestro configuration
mray190 Jul 15, 2021
28cccfa
Removed maestro templating, replaced with static files
mray190 Jul 15, 2021
c96f337
Removed maestro-shell
mray190 Jul 15, 2021
1950726
Bug fix: Fix maestro changelog, updated timestamp and patch
mray190 Nov 1, 2021
1451cf6
Documentation: Add fluent-bit service to readme info
mray190 Nov 3, 2021
ebce493
Update maestro to version 3.0.0, without grease (#178)
Nov 11, 2021
6c55cfa
upgrade mbed-edge-core packages to 0.15.0
costanic Feb 23, 2021
39750c5
Modified maestro config to add GRM feature
costanic Nov 16, 2021
aa12e26
update edge-proxy to v1.0.0
costanic Nov 16, 2021
afe5947
Upgrade edge-core to 0.16.1 for Pelion Edge 2.3
costanic Nov 16, 2021
d77f5a4
Upgrade edge-core to 0.18.0 for Pelion Edge 2.4
costanic Nov 16, 2021
85c6ca2
byoc version of edge-core
costanic Jul 30, 2021
58b861e
bump metapackage versions to 2.4.0 for Pelion Edge 2.4
costanic Nov 16, 2021
a05edf3
try to simplify the github action
costanic Nov 19, 2021
c850e5e
prune docker images after each build
costanic Nov 19, 2021
8e7b0d9
fix rpm: update kubelet golang version dependency
costanic Nov 19, 2021
1b0bb07
update kubelet to v1.0.0
costanic Nov 24, 2021
e8355b9
Added new pe-terminal (formerly relay-term) deb-package
Jul 19, 2021
d3221ed
Added new pe-terminal (formerly relay-term) rpm-package
Jul 19, 2021
dc067f0
Added source-tag for terminal, updated version to match the release
Sep 13, 2021
9eb71e8
Updated changelog to include version revision
Sep 13, 2021
a6b308d
Fixed debuild errors, added lintian-overrides
Sep 15, 2021
feb5214
replace relay-term with pe-terminal in the metapackages
costanic Dec 6, 2021
5c13406
prevent relay-term from auto running after install
costanic Dec 6, 2021
62be723
Backport from master (#224)
petedyerarm Dec 8, 2022
28939fa
Fix domain names. (#225)
petedyerarm Dec 8, 2022
76c5e54
Merge branch 'master' into dev
petedyerarm Feb 15, 2024
bdb3ba6
Fix maestro build. (#227)
petedyerarm Feb 16, 2024
7fd2d10
Update action. (#228)
petedyerarm Mar 8, 2024
121f8e1
Update component version to latest. (#229)
petedyerarm Mar 15, 2024
131fff4
Replace maestro with edge-resource-manager. (#230)
petedyerarm Mar 18, 2024
937f8c4
build.yml - add some fixes
JanneKiiskila Sep 10, 2024
c6e865d
Merge pull request #231 from PelionIoT/ci-fix
JanneKiiskila Sep 11, 2024
6389dd7
Update README.md sudo systemctl enable
JanneKiiskila Sep 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 14 additions & 25 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,23 @@
name: Build
on: push
on:
push:
workflow_dispatch:

jobs:
build-docker-images-using-docker-18_09:
runs-on: ubuntu-18.04
strategy:
matrix:
distro: [buster, bionic, focal]
steps:
- name: Downgrade docker to 18.09
run: |
sudo apt-get remove -y moby-buildx moby-cli moby-engine moby-containerd moby-runc
wget https://download.docker.com/linux/ubuntu/dists/bionic/pool/stable/amd64/docker-ce_18.09.9~3-0~ubuntu-bionic_amd64.deb
wget https://download.docker.com/linux/ubuntu/dists/bionic/pool/stable/amd64/docker-ce-cli_18.09.9~3-0~ubuntu-bionic_amd64.deb
wget https://download.docker.com/linux/ubuntu/dists/bionic/pool/stable/amd64/containerd.io_1.2.2-3_amd64.deb
sudo dpkg -i docker-ce_18.09.9~3-0~ubuntu-bionic_amd64.deb docker-ce-cli_18.09.9~3-0~ubuntu-bionic_amd64.deb containerd.io_1.2.2-3_amd64.deb
- name: Print downgraded docker version
run: |
docker --version
- name: Check out code
uses: actions/checkout@v2
- name: Build docker image
run: |
export DOCKER_OPTS='-i'; ./build-env/bin/docker-run-env.sh ${{ matrix.distro }} true
build-debs:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
matrix:
distro: [buster, bullseye, bionic, focal]
distro: [bullseye, focal]
arch: [amd64, arm64, armhf]
fail-fast: false
steps:
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set access token for internal repo access
uses: PelionIoT/actions/.github/actions/git-config@main
with:
github_token: ${{ secrets.ACCESS_TOKEN }}
- name: Copy mbed_cloud_dev_credentials.c
env:
MBED_CLOUD_DEV_CREDENTIALS: ${{ secrets.MBED_CLOUD_DEV_CREDENTIALS_C_RYAN }}
Expand All @@ -46,3 +31,7 @@ jobs:
- name: Build
run: |
export DOCKER_OPTS='-i'; ./build-env/bin/docker-run-env.sh ${{ matrix.distro }} ./build-env/bin/build-all.sh --install --arch=${{ matrix.arch }}
docker system prune -f
- name: Cleanup .gitconfig
if: always()
run: rm -f ~/.gitconfig
45 changes: 25 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ be launched manually, for example as an interactive session, or the scripts will
run docker automatically if the argument `--docker` is provided.

It is recommended to use docker since it will provide a clean environment
without interference with local user settings (for example, with user nodejs or
python environments) and does not require setting up local packages repository.
without interference with local user settings (for example, with user python
environments) and does not require setting up local packages repository.

Also, the build will need `sudo` privileges to install standard Ubuntu packages.

Expand Down Expand Up @@ -216,7 +216,7 @@ When `build-all.sh` is run:
and source stage). Container is removed after each element is done:
```
# create and run temporary container
[docker run --rm] pe-nodejs source
[docker run --rm] pe-utils source
# container is automatically removed
# create and run temporary container
[docker run --rm] edge-proxy source
Expand All @@ -229,10 +229,10 @@ uses it for each element:
```
[check if container exists => create if missing]
[if stopped => docker start]
[docker exec] pe-nodejs source
[docker exec] pe-utils source
[docker exec] edge-proxy source
...
[docker exec] pe-nodejs build
[docker exec] pe-utils build
```

- with `-c=clean` removes existing container and creates new one before first
Expand All @@ -243,10 +243,10 @@ use in script:
# create new container
[docker container create]
[docker start]
[docker exec] pe-nodejs source
[docker exec] pe-utils source
[docker exec] edge-proxy source
...
[docker exec] pe-nodejs build
[docker exec] pe-utils build
...
```

Expand All @@ -273,16 +273,19 @@ or
The build scripts provide help information, for example:

```
$ maestro/deb/build.sh --help
Usage: maestro/deb/build.sh [Options]
$ pe-utils/deb/build.sh --help
Usage: pe-utils/deb/build.sh [Options]

Options:
--docker=<dist> Use docker containers (dist can be focal, bionic, buster...).
--docker Use docker containers.
--source Generate source package.
--build Build binary from source generated with --source option.
--verify Verify package conformity to the Debian policy.
--install Install build dependencies.
--arch=<arch> Set target architecture.
--print-target Print target package file path and exit
--print-package-name Print package name (eg. devicejs) and exit
--print-package-version Print package version (eg. devicejs) and exit
--help,-h Print this message.

If none of '--source', '--build' or '--verify' options are specified,
Expand All @@ -292,8 +295,9 @@ Available architectures:
amd64
arm64
armhf
armel

Default mode: maestro/deb/build.sh --arch=amd64 --source --build --verify
Default mode: pe-utils/deb/build.sh --arch=amd64 --source --build --verify
```

These scripts can be used to generate both source and binary packages.
Expand All @@ -306,8 +310,8 @@ run in appropriate containers automatically (using source of build images):
The build scripts for RPM-based distributions are similar to Debian's:

```
$ ./maestro/rpm/build.sh --help
build.sh - builds maestro RPM package
$ pe-utils/rpm/build.sh --help
build.sh - builds pe-utils RPM package

Usage: build.sh [-h|--help] [--install]
-h, --help display this help message.
Expand Down Expand Up @@ -517,29 +521,30 @@ directory run:
sudo yum install *.rpm
```

Please note that `mbed-edge-core` and `mbed-edge-core-devmode` cannot be
installed simultaneously.
Please note that `mbed-edge-core`, `mbed-edge-core-devmode`, and `mbed-edge-core-byocmode`
cannot be installed simultaneously.

4. Enable `systemd` services. After installation there are following services:
```
edge-core.service
edge-proxy.service
kubelet.service
maestro.service
edge-resource-manager.service
mbed-fcc.service
pelion-relay-term.service
pe-terminal.service
wait-for-pelion-identity.service
fluent-bit.service
```

To enable all services, run:
```bash
sudo systemctl enable edge-core.service edge-proxy.service kubelet.service maestro.service mbed-fcc.service pelion-relay-term.service wait-for-pelion-identity.service
sudo systemctl enable edge-core.service edge-proxy.service kubelet.service edge-resource-manager.service mbed-fcc.service pe-terminal.service wait-for-pelion-identity.service
```

Dependent services are enabled implicitly. For example
`wait-for-pelion-identity.service` is enabled when `maestro.service` is
`wait-for-pelion-identity.service` is enabled when `edge-resource-manager.service` is
enabled; `edge-core.service` is enabled when `wait-for-pelion-identity.service`
is enabled so enabling `maestro.service` will also enable
is enabled so enabling `edge-resource-manager.service` will also enable
`wait-for-pelion-identity.service` and `edge-core.service`.


Expand Down
2 changes: 1 addition & 1 deletion build-env/bin/deb2tar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ fetch_deps() {
'/^pe-utils/d'
'/^edge-proxy/d'
'/^mbed-edge-core-devmode/d'
'/^maestro/d'
'/^edge-resource-manager/d'
'/^containernetworking-plugins/d'
'/^debconf/d'
'/^dpkg/d'
Expand Down
18 changes: 3 additions & 15 deletions build-env/bin/pelion-build-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,16 @@ source "${ROOT_DIR}"/build-env/docker/common/create-repo-lib.sh
# variables are evaluated in selected environment (eg. docker)
DEPENDS=(
'${GO_COMPILER_PACKAGE-golang-providers/golang-virtual}'
'pe-nodejs'
)

# TODO: do not duplicate for amd64 only build
PACKAGES=(
'pe-nodejs'
'edge-proxy'
'global-node-modules'
'kubelet'
'maestro'
'maestro-shell'
'edge-resource-manager'
'mbed-edge-core'
'mbed-edge-core-devmode'
'mbed-edge-core-byocmode'
'golang-github-containernetworking-plugins'
'mbed-edge-examples'
'mbed-fcc'
Expand Down Expand Up @@ -222,16 +219,7 @@ if $PELION_PACKAGE_SOURCE; then
echo ">> Source creation started"
for p in "${PACKAGES[@]}"; do
echo "Generating source package of '$p'"
if [ "$p" == "pe-nodejs" ]; then
# pe-nodejs is just a debian package of pre-built # source.
# We need to pass the arch here so we know what binary tarball
# architecture to download.
for arch in "${PELION_ARCHS[@]}"; do
"$SCRIPT_DIR"/../../"$p"/deb/build.sh $PELION_BUILD_OPT --arch="$arch" --source
done
else
"$SCRIPT_DIR"/../../"$p"/deb/build.sh $PELION_BUILD_OPT --source
fi
"$SCRIPT_DIR"/../../"$p"/deb/build.sh $PELION_BUILD_OPT --source
done
echo ">> Source creation finished"
fi
Expand Down
2 changes: 1 addition & 1 deletion build-env/inc/macros.go-rpm
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ buildmode="-buildmode pie"
%else
buildmode=
%endif
%{?gobuilddir:GOPATH="%{gobuilddir}:${GOPATH:+${GOPATH}:}%{?gopath}"} GO111MODULE=off \\
%{?gobuilddir:GOPATH="%{gobuilddir}:${GOPATH:+${GOPATH}:}%{?gopath}"} GO111MODULE=auto \\
go build $buildmode -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-}%{?currentgoldflags} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags %{?__golang_extldflags}'" -a -v -x %{?**};
}
8 changes: 3 additions & 5 deletions build-env/target/common/debian_packages.conf.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
# build dependencies
DEPENDS=(
'golang-providers/golang-virtual'
'pe-nodejs'
)

PACKAGES=(
'pe-nodejs'
'edge-proxy'
'global-node-modules'
'pe-terminal'
'kubelet'
'maestro'
'maestro-shell'
'edge-resource-manager'
'mbed-edge-core'
'mbed-edge-core-devmode'
'mbed-edge-core-byocmode'
'golang-github-containernetworking-plugins'
'mbed-edge-examples'
'mbed-fcc'
Expand Down
1 change: 0 additions & 1 deletion build-env/target/debian/bullseye/packages.conf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ source $ENV_TARGET_ROOT/common/debian_packages.conf.sh

DEPENDS=(
'golang-providers/pe-golang-bin'
'pe-nodejs'
)

ENV_OS_NAME=bullseye
Expand Down
1 change: 0 additions & 1 deletion build-env/target/debian/buster/packages.conf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ source $ENV_TARGET_ROOT/common/debian_packages.conf.sh

DEPENDS=(
'golang-providers/pe-golang-bin'
'pe-nodejs'
)

ENV_OS_NAME=buster
Expand Down
8 changes: 1 addition & 7 deletions build-env/target/rhel/8/packages.conf.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
# build dependencies
# variables are evaluated in selected environment (eg. docker)
DEPENDS=(
'pe-nodejs'
)

PACKAGES=(
'pe-nodejs'
'edge-proxy'
'global-node-modules'
'golang-github-containernetworking-plugins'
'kubelet'
'maestro'
'maestro-shell'
'mbed-edge-core'
'mbed-edge-core-devmode'
'mbed-edge-core-byocmode'
'mbed-edge-examples'
'mbed-fcc'
'pe-utils'
Expand Down
1 change: 0 additions & 1 deletion build-env/target/ubuntu/bionic/packages.conf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ source $ENV_TARGET_ROOT/common/debian_packages.conf.sh

DEPENDS=(
'golang-providers/pe-golang-bin'
'pe-nodejs'
)

ENV_OS_NAME=bionic
Expand Down
2 changes: 1 addition & 1 deletion edge-proxy/deb/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PELION_PACKAGE_NAME="edge-proxy"
PELION_PACKAGE_DIR=$(cd "`dirname \"$0\"`" && pwd)

declare -A PELION_PACKAGE_COMPONENTS=(
["https://github.com/PelionIoT/edge-proxy.git"]="v1.1.0")
["https://github.com/PelionIoT/edge-proxy.git"]="v1.3.0")

source "$PELION_PACKAGE_DIR"/../../build-env/inc/build-common.sh

Expand Down
6 changes: 6 additions & 0 deletions edge-proxy/deb/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
edge-proxy (1.3.0-1) stable; urgency=medium

* Updated to use v1.3.0

-- Pete Dyer <[email protected]> Fri, 08 Mar 2024 15:58:21 +0000

edge-proxy (1.1.0-1) unstable; urgency=medium

* fix CVE-2021-33194
Expand Down
2 changes: 1 addition & 1 deletion edge-proxy/deb/debian/copyright
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: edge-proxy
Source: https://github.com/armPelionEdge/edge-proxy
Source: https://github.com/PelionIoT/edge-proxy

Files: *
Copyright: 2019, Travis McCollum <[email protected]>
12 changes: 8 additions & 4 deletions edge-proxy/rpm/edge-proxy.spec
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
%global goipath github.com/armPelionEdge/edge-proxy
%global tag v0.9.0
%global version v0.9.0
%global goipath github.com/PelionIoT/edge-proxy
%global tag v1.0.0
%global version v1.0.0
%gometa

Name: edge-proxy
Version: 0.9.0
Version: 1.0.0
Release: 1%{?dist}
Summary: An HTTP proxy for Pelion Edge

Expand Down Expand Up @@ -53,6 +53,10 @@ install -vpm 0755 %{_filesdir}/edge-proxy.service %{buildroot}/%{_unitdir}
%systemd_postun_with_restart edge-proxy.service

%changelog
* Tue Nov 16 2021 Nic Costa <[email protected]> - 1.0.0-1
- Adds proxy-only mode which allows edge-proxy to run HTTP and HTTPS servers
* Wed Jun 9 2021 Michael Ray <[email protected]> - 0.9.0-1
- Adds proxy-only mode which allows edge-proxy to run HTTP and HTTPS servers
* Wed Jun 9 2021 Michael Ray <[email protected]> - 0.9.0-1
- Locked down version of all packages
* Wed May 20 2020 Vasily Smirnov <[email protected]> - 0.0.1-1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
#!/bin/bash

# Internal variables
PELION_PACKAGE_NAME="maestro-shell"
PELION_PACKAGE_NAME="edge-resource-manager"
PELION_PACKAGE_DIR=$(cd "`dirname \"$0\"`" && pwd)

#exported the branch so we can use it in auto_build script
export PACKAGE_BRANCH="v2.8.0"
PELION_PACKAGE_PRE_BUILD_CALLBACK='select_python 3'

declare -A PELION_PACKAGE_COMPONENTS=(
["https://github.com/armPelionEdge/maestro-shell.git"]="$PACKAGE_BRANCH")
["https://github.com/PelionIoT/edge-resource-manager.git"]="v1.0.0")

source "$PELION_PACKAGE_DIR"/../../build-env/inc/build-common.sh

Expand Down
17 changes: 17 additions & 0 deletions edge-resource-manager/deb/debian/auto_build
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

set -e

export CC="${DEB_HOST_GNU_TYPE}"-gcc
export CXX="${DEB_HOST_GNU_TYPE}"-g++
export PKG_CONFIG="${DEB_HOST_GNU_TYPE}"-pkg-config

export CONFIG_OPTIONS="--host=${DEB_HOST_GNU_TYPE}"

export CGO_ENABLED=1
export GOPATH="`pwd`/go-workspace"

eval `debian/goflags.guess ${DEB_HOST_ARCH}`

mkdir -p bin
go build -o bin/edge-resource-manager -buildmode=pie --tags debug edge-resource-manager.go
Loading