Skip to content

Commit

Permalink
Pull request 2179: upd-docker
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit 17e145c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Wed Mar 20 18:49:18 2024 +0300

    bamboo-specs: upd builder img

commit d6399a0
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Wed Mar 20 18:35:01 2024 +0300

    bamboo-specs: fix frontend build

commit 9f4cbf5
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Wed Mar 20 18:21:50 2024 +0300

    bamboo-specs: fix yaml

commit a26d2ab
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Wed Mar 20 18:18:57 2024 +0300

    all: use new docker imgs
  • Loading branch information
ainar-g committed Mar 20, 2024
1 parent 0542339 commit 54f77c0
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 69 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@
'path': '${{ steps.npm-cache.outputs.dir }}'
'key': "${{ runner.os }}-node-${{ hashFiles('client/package-lock.json') }}"
'restore-keys': '${{ runner.os }}-node-'
- 'name': 'Run make ci'
- 'name': 'Run tests'
'shell': 'bash'
'run': 'make VERBOSE=1 ci'
'run': 'make VERBOSE=1 deps test go-bench go-fuzz'
- 'name': 'Upload coverage'
'uses': 'codecov/codecov-action@v1'
'if': "success() && matrix.os == 'ubuntu-latest'"
Expand Down
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ See also the [v0.107.47 GitHub milestone][ms-v0.107.47].
NOTE: Add new changes BELOW THIS COMMENT.
-->

### Deprecated

- Node.JS 16. Future versions will require at least Node.JS 18 to build.

<!--
NOTE: Add new changes ABOVE THIS COMMENT.
-->
Expand All @@ -42,11 +46,11 @@ See also the [v0.107.46 GitHub milestone][ms-v0.107.46].

### Changed

- Private RDNS resolution (`dns.use_private_ptr_resolvers` in YAML
- Private rDNS resolution (`dns.use_private_ptr_resolvers` in YAML
configuration) now requires a valid "Private reverse DNS servers", when
enabled ([#6820]).

**NOTE:** Disabling private RDNS resolution behaves effectively the same as if
**NOTE:** Disabling private rDNS resolution behaves effectively the same as if
no private reverse DNS servers provided by user and by the OS.

### Fixed
Expand Down
15 changes: 4 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ build: deps quick-build

quick-build: js-build go-build

ci: deps test go-bench go-fuzz

deps: js-deps go-deps
lint: js-lint go-lint
test: js-test go-test
Expand All @@ -98,15 +96,10 @@ build-release: $(BUILD_RELEASE_DEPS_$(FRONTEND_PREBUILT))
clean: ; $(ENV) "$(SHELL)" ./scripts/make/clean.sh
init: ; git config core.hooksPath ./scripts/hooks

js-build:
$(NPM) $(NPM_FLAGS) run build-prod
js-deps:
$(NPM) $(NPM_INSTALL_FLAGS) ci

# TODO(a.garipov): Remove the legacy client tasks support once the new
# client is done and the old one is removed.
js-lint: ; $(NPM) $(NPM_FLAGS) run lint
js-test: ; $(NPM) $(NPM_FLAGS) run test
js-build: ; $(NPM) $(NPM_FLAGS) run build-prod
js-deps: ; $(NPM) $(NPM_INSTALL_FLAGS) ci
js-lint: ; $(NPM) $(NPM_FLAGS) run lint
js-test: ; $(NPM) $(NPM_FLAGS) run test

go-bench: ; $(ENV) "$(SHELL)" ./scripts/make/go-bench.sh
go-build: ; $(ENV) "$(SHELL)" ./scripts/make/go-build.sh
Expand Down
50 changes: 19 additions & 31 deletions bamboo-specs/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
# Make sure to sync any changes with the branch overrides below.
'variables':
'channel': 'edge'
# TODO(a.garipov): Split away the frontend image.
'dockerFrontend': 'adguard/golang-ubuntu:9.0'
'dockerFrontend': 'adguard/home-js-builder:1.1'
'dockerGo': 'adguard/go-builder:1.21.8--1'

'stages':
Expand Down Expand Up @@ -42,9 +41,12 @@
'jobs':
- 'Publish to GitHub Releases'

# TODO(e.burkov): In jobs below find out why the explicit checkout is
# performed.
'Build frontend':
'artifacts':
- 'name': 'AdGuardHome frontend'
'pattern': 'build/**'
'shared': true
'required': true
'docker':
'image': '${bamboo.dockerFrontend}'
'volumes':
Expand All @@ -63,19 +65,21 @@
set -e -f -u -x
# Explicitly checkout the revision that we need.
git checkout "${bamboo.repository.revision.number}"
make js-deps js-build
'artifacts':
- 'name': 'AdGuardHome frontend'
'pattern': 'build/**'
'shared': true
'required': true
make\
VERBOSE=1\
js-deps js-build
'requirements':
- 'adg-docker': 'true'

'Make release':
'artifact-subscriptions':
- 'artifact': 'AdGuardHome frontend'
# TODO(a.garipov): Use more fine-grained artifact rules.
'artifacts':
- 'name': 'AdGuardHome dists'
'pattern': 'dist/**'
'shared': true
'required': true
'docker':
'image': '${bamboo.dockerGo}'
'volumes':
Expand All @@ -95,9 +99,6 @@
set -e -f -u -x
# Explicitly checkout the revision that we need.
git checkout "${bamboo.repository.revision.number}"
# Run the build with the specified channel.
echo "${bamboo.gpgSecretKeyPart1}${bamboo.gpgSecretKeyPart2}"\
| awk '{ gsub(/\\n/, "\n"); print; }'\
Expand All @@ -110,12 +111,6 @@
PARALLELISM=1\
VERBOSE=2\
build-release
# TODO(a.garipov): Use more fine-grained artifact rules.
'artifacts':
- 'name': 'AdGuardHome dists'
'pattern': 'dist/**'
'shared': true
'required': true
'requirements':
- 'adg-docker': 'true'

Expand All @@ -134,13 +129,6 @@
set -e -f -u -x
COMMIT="${bamboo.repository.revision.number}"
export COMMIT
readonly COMMIT
# Explicitly checkout the revision that we need.
git checkout "$COMMIT"
# Install Qemu, create builder.
docker version -f '{{ .Server.Experimental }}'
docker buildx rm buildx-builder || :
Expand Down Expand Up @@ -276,7 +264,7 @@
# need to build a few of these.
'variables':
'channel': 'beta'
'dockerFrontend': 'adguard/golang-ubuntu:9.0'
'dockerFrontend': 'adguard/home-js-builder:1.1'
'dockerGo': 'adguard/go-builder:1.21.8--1'
# release-vX.Y.Z branches are the branches from which the actual final
# release is built.
Expand All @@ -292,5 +280,5 @@
# are the ones that actually get released.
'variables':
'channel': 'release'
'dockerFrontend': 'adguard/golang-ubuntu:9.0'
'dockerFrontend': 'adguard/home-js-builder:1.1'
'dockerGo': 'adguard/go-builder:1.21.8--1'
6 changes: 3 additions & 3 deletions bamboo-specs/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# Make sure to sync any changes with the branch overrides below.
'variables':
'channel': 'edge'
'dockerSnap': 'adguard/snap-builder:1.0'
'dockerSnap': 'adguard/snap-builder:1.1'
'snapcraftChannel': 'edge'

'stages':
Expand Down Expand Up @@ -191,7 +191,7 @@
# need to build a few of these.
'variables':
'channel': 'beta'
'dockerSnap': 'adguard/snap-builder:1.0'
'dockerSnap': 'adguard/snap-builder:1.1'
'snapcraftChannel': 'beta'
# release-vX.Y.Z branches are the branches from which the actual final
# release is built.
Expand All @@ -207,5 +207,5 @@
# are the ones that actually get released.
'variables':
'channel': 'release'
'dockerSnap': 'adguard/snap-builder:1.0'
'dockerSnap': 'adguard/snap-builder:1.1'
'snapcraftChannel': 'candidate'
105 changes: 85 additions & 20 deletions bamboo-specs/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,62 @@
'key': 'AHBRTSPECS'
'name': 'AdGuard Home - Build and run tests'
'variables':
# TODO(a.garipov): Split away the frontend image and stages.
'dockerGo': 'adguard/golang-ubuntu:9.0'
'dockerFrontend': 'adguard/home-js-builder:1.1'
'dockerGo': 'adguard/go-builder:1.21.8--1'
'channel': 'development'

'stages':
- 'Tests':
'manual': false
'final': false
'jobs':
- 'Test'
- 'Test frontend'
- 'Test backend'

- 'Frontend':
manual: false
final: false
jobs:
- 'Build frontend'

- 'Artifact':
manual: false
final: false
jobs:
- 'Artifact'

'Test':
'Test frontend':
'docker':
'image': '${bamboo.dockerGo}'
'image': '${bamboo.dockerFrontend}'
'volumes':
'${system.YARN_DIR}': '${bamboo.cacheYarn}'
'key': 'JSTEST'
'other':
'clean-working-dir': true
'tasks':
- 'checkout':
'force-clean-build': true
- 'script':
'interpreter': 'SHELL'
'scripts':
- |
#!/bin/sh
set -e -f -u -x
make VERBOSE=1 js-deps js-lint js-test
'final-tasks':
- 'clean'
'requirements':
- 'adg-docker': 'true'

'Test backend':
'docker':
'image': '${bamboo.dockerGo}'
'volumes':
'${system.GO_CACHE_DIR}': '${bamboo.cacheGo}'
'${system.GO_PKG_CACHE_DIR}': '${bamboo.cacheGoPkg}'
'key': 'TEST'
'key': 'GOTEST'
'other':
'clean-working-dir': true
'tasks':
Expand All @@ -43,19 +74,23 @@
set -e -f -u -x
make VERBOSE=1 ci go-tools lint
make VERBOSE=1 go-deps go-tools go-lint go-test
'final-tasks':
- 'clean'
'requirements':
- 'adg-docker': 'true'

'Artifact':
'Build frontend':
'artifacts':
- 'name': 'AdGuardHome frontend'
'pattern': 'build/**'
'shared': true
'required': true
'docker':
'image': '${bamboo.dockerGo}'
'image': '${bamboo.dockerFrontend}'
'volumes':
'${system.GO_CACHE_DIR}': '${bamboo.cacheGo}'
'${system.GO_PKG_CACHE_DIR}': '${bamboo.cacheGoPkg}'
'key': 'ART'
'${system.YARN_DIR}': '${bamboo.cacheYarn}'
'key': 'BF'
'other':
'clean-working-dir': true
'tasks':
Expand All @@ -70,13 +105,14 @@
set -e -f -u -x
make\
ARCH="amd64"\
OS="windows darwin linux"\
CHANNEL=${bamboo.channel}\
SIGN=0\
PARALLELISM=1\
VERBOSE=2\
build-release
VERBOSE=1\
js-deps js-build
'requirements':
- 'adg-docker': 'true'

'Artifact':
'artifact-subscriptions':
- 'artifact': 'AdGuardHome frontend'
'artifacts':
- 'name': 'AdGuardHome_windows_amd64'
'pattern': 'dist/AdGuardHome_windows_amd64.zip'
Expand All @@ -90,6 +126,34 @@
'pattern': 'dist/AdGuardHome_linux_amd64.tar.gz'
'shared': true
'required': true
'docker':
'image': '${bamboo.dockerGo}'
'volumes':
'${system.GO_CACHE_DIR}': '${bamboo.cacheGo}'
'${system.GO_PKG_CACHE_DIR}': '${bamboo.cacheGoPkg}'
'key': 'ART'
'other':
'clean-working-dir': true
'tasks':
- 'checkout':
'force-clean-build': true
- 'script':
'interpreter': 'SHELL'
'scripts':
- |-
#!/bin/sh
set -e -f -u -x
make\
ARCH="amd64"\
CHANNEL=${bamboo.channel}\
FRONTEND_PREBUILT=1\
OS="windows darwin linux"\
PARALLELISM=1\
SIGN=0\
VERBOSE=2\
build-release
'requirements':
- 'adg-docker': 'true'

Expand Down Expand Up @@ -123,5 +187,6 @@
# Set the default release channel on the release branch to beta, as we
# may need to build a few of these.
'variables':
'dockerGo': 'adguard/golang-ubuntu:9.0'
'dockerFrontend': 'adguard/home-js-builder:1.1'
'dockerGo': 'adguard/go-builder:1.21.8--1'
'channel': 'candidate'

0 comments on commit 54f77c0

Please sign in to comment.