Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
d39c297
Experimenting with different build mechanism for better caching.
GUI Jun 10, 2018
9109f7c
More experiments with better build caching.
GUI Jun 11, 2018
8e59fc7
Some build fixes.
GUI Jun 11, 2018
77d260e
More build script setup.
GUI Jun 12, 2018
78c6ac2
Fix some linting issues in new files Rubocop is testing now.
GUI Jun 12, 2018
b04560d
Remove lint rake task in favor of tasks/lint scripts.
GUI Jun 12, 2018
a3fe30a
Update outdated task to work with new tasks setup.
GUI Jun 12, 2018
f394abe
Fix shell linting.
GUI Jun 12, 2018
7d38966
Fix lint call in CI script.
GUI Jun 12, 2018
71c0af3
Remove cmake based setup.
GUI Jun 12, 2018
c975016
Remove unnecessary node_modules files.
GUI Jun 12, 2018
b5be6a5
Update development docker build process for new task-based builds.
GUI Jun 12, 2018
9d63e05
More build fixes.
GUI Jun 12, 2018
dc2ab4a
Use multi-stage build for development build.
GUI Jun 12, 2018
247980c
Re-add configure step to CI setup.
GUI Jun 12, 2018
071823f
Fix symlink paths to fix running yarn lint in CI environment.
GUI Jun 14, 2018
fb67bcc
Attempt to fix CI caching to retain node_modules and gems.
GUI Jun 14, 2018
d127cd1
Fixes for the CI task due to reorganized tasks.
GUI Jun 14, 2018
9c3128b
Bust CI cache.
GUI Jun 14, 2018
07c7615
Fix rpath tests with new build process.
GUI Jun 14, 2018
d58e0a1
Merge remote-tracking branch 'origin/master' into build-caching
GUI Jun 15, 2018
821d714
Fix build install location for web assets.
GUI Jun 15, 2018
5c1b4de
Trying to tweak CI caching variable setup.
GUI Jun 15, 2018
6a20246
Persist a few things differently to deal with build caching.
GUI Jun 15, 2018
7b2e589
Shift build script into tasks directory for better standardization.
GUI Jun 15, 2018
6d6ce81
Fix build/test caching for mongo-orchestration.
GUI Jun 15, 2018
1181024
Update packaging process for new builds setup.
GUI Jun 15, 2018
c021b7b
Fix mongo-orchestration caching for CI builds.
GUI Jun 15, 2018
ba7d362
Add task for running "outdated" script.
GUI Jun 15, 2018
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
37 changes: 25 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,43 @@ jobs:
working_directory: /app
docker:
- image: ubuntu:16.04
environment:
CACHE_VERSION: v1
steps:
- checkout
# Install any system package dependencies.
- run: env INSTALL_TEST_DEPENDENCIES=true ./build/scripts/install_build_dependencies
- run: env INSTALL_TEST_DEPENDENCIES=true ./tasks/install-system-build-dependencies
- restore_cache:
# CircleCI's prefix based matching will mean the cache from the last
# cache for this branch will be restored.
key: cache-build-deps-{{ .Environment.CACHE_VERSION }}-{{ .Branch }}-{{ arch }}-
# The bootstrap's "task" file will be cached on subsequent runs, but due
# to the reliance on timestamps, this fact might not get picked up in the
# CI environment. So if a stamp file exists for the initial bootstrap
# process, re-touch it to prevent re-downloads.
- run: touch -c build/work/stamp/bootstrap-*
# Build all the API Umbrella software dependencies.
- run: ./configure
- run: make all test-deps test-bundle
- run: make all test-deps
# Cache the staged build data and task checksums of what's been
# completed. But explicitly don't cache most of the build/work/tasks/*
# data, since that contains a lot of the intermediate build files, which
# can significantly increase the cache size.
- save_cache:
key: cache-build-deps-{{ .Environment.CACHE_VERSION }}-{{ .Branch }}-{{ arch }}-{{ epoch }}
paths:
- build/work
- CMakeCache.txt
- CMakeFiles
- Makefile
- cmake_install.cmake
- type: shell
command: |
groupadd -r api-umbrella
useradd -r -g api-umbrella -s /sbin/nologin -d /opt/api-umbrella -c "API Umbrella user" api-umbrella
./test/scripts/circle-ci
- .task
- build/work/dev-env
- build/work/stage
- build/work/stamp
- build/work/task
- build/work/tasks/app-deps/admin-ui/yarn/_persist
- build/work/tasks/app-deps/web-app/bundle/_persist
- build/work/tasks/app/admin-ui/build/_persist/dist
- build/work/tasks/app/web-app/precompile/_persist/public/web-assets
- build/work/tasks/test-deps/bundle/_persist
- build/work/test-env
- run: make test:circle-ci
- store_test_results:
path: test/tmp/reports
- store_artifacts:
Expand Down
17 changes: 2 additions & 15 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,33 +1,20 @@
# CMake
CMakeCache.txt
CMakeFiles
Makefile
cmake_install.cmake
install_manifest.txt
install_manifest_core.txt
install_manifest_hadoop-analytics.txt

.task
build/work
build/package/work
build/package/verify/.rnd

.vagrant
workspace
chef/cookbooks
chef/tmp
.bundle
.ruby-version
CMakeCache.txt
CMakeFiles
Dockerfile*
Makefile
cmake_install.cmake
docker-compose.yml
install_manifest.txt
install_manifest_core.txt
install_manifest_hadoop-analytics.txt
build/work
build/package/work
build/package/verify/.rnd
deploy/.env
deploy/log
deploy/tmp
Expand Down
13 changes: 4 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,13 @@
# Ignore bundler config
/.bundle

# Ignore Circle CI items, so the GitHub pages publish task can work.
# Ignore Circle CI items, so the GitHub pages publish task can work.
/.ruby-version

# CMake
/CMakeCache.txt
/CMakeFiles
/Makefile
/cmake_install.cmake
/install_manifest.txt
/install_manifest_core.txt
/install_manifest_hadoop-analytics.txt
# Build task checksums
/.task

/Makefile
/build/work
/build/package/work
/build/package/verify/.rnd
Expand Down
92 changes: 0 additions & 92 deletions CMakeLists.txt

This file was deleted.

65 changes: 35 additions & 30 deletions Dockerfile-dev-build
Original file line number Diff line number Diff line change
@@ -1,54 +1,59 @@
FROM ubuntu:16.04
FROM ubuntu:16.04 AS build

RUN mkdir -p /app/build /build/build/work
RUN ln -snf /build/build/work /app/build/work
WORKDIR /app

RUN mkdir /app
RUN mkdir /build
WORKDIR /build
ENV DOCKER_DEV true
ENV NOKOGIRI_USE_SYSTEM_LIBRARIES 1

COPY build/scripts/install_build_dependencies /app/build/scripts/install_build_dependencies
COPY tasks/install-system-build-dependencies /app/tasks/install-system-build-dependencies
COPY build/package_dependencies.sh /app/build/package_dependencies.sh
RUN env INSTALL_TEST_DEPENDENCIES=true /app/build/scripts/install_build_dependencies

COPY build/scripts/download_cmake /app/build/scripts/download_cmake
RUN /app/build/scripts/download_cmake
RUN env INSTALL_TEST_DEPENDENCIES=true /app/tasks/install-system-build-dependencies

COPY CMakeLists.txt /app/CMakeLists.txt
COPY build/cmake/functions /app/build/cmake/functions
COPY build/cmake/deps /app/build/cmake/deps
COPY build/cmake/deps.cmake /app/build/cmake/deps.cmake
COPY build/patches /app/build/patches
COPY Makefile.in /app/Makefile.in
COPY Taskfile.yml /app/Taskfile.yml
COPY configure /app/configure
RUN /app/configure && make deps
COPY tasks/bootstrap-* /app/tasks/
COPY tasks/helpers.sh /app/tasks/helpers.sh
RUN ./configure

COPY build/cmake/build-deps /app/build/cmake/build-deps
COPY build/cmake/build-deps.cmake /app/build/cmake/build-deps.cmake
RUN /app/configure && make build-deps
COPY build/patches /app/build/patches
COPY tasks/deps /app/tasks/deps
RUN make deps

COPY build/cmake/test-deps /app/build/cmake/test-deps
COPY build/cmake/test-deps.cmake /app/build/cmake/test-deps.cmake
RUN /app/configure && make test-deps
COPY tasks/build-deps /app/tasks/build-deps
RUN make build-deps

COPY Gemfile /app/Gemfile
COPY Gemfile.lock /app/Gemfile.lock
COPY build/cmake/test-bundle.cmake /app/build/cmake/test-bundle.cmake
RUN /app/configure && make test-bundle
COPY tasks/test-deps /app/tasks/test-deps
RUN make test-deps

COPY build/cmake/app-deps /app/build/cmake/app-deps
COPY build/cmake/app-deps.cmake /app/build/cmake/app-deps.cmake
RUN /app/configure && make app-deps
COPY src/api-umbrella/admin-ui/package.json /app/src/api-umbrella/admin-ui/package.json
COPY src/api-umbrella/admin-ui/yarn.lock /app/src/api-umbrella/admin-ui/yarn.lock
COPY src/api-umbrella/web-app/Gemfile /app/src/api-umbrella/web-app/Gemfile
COPY src/api-umbrella/web-app/Gemfile.lock /app/src/api-umbrella/web-app/Gemfile.lock
COPY tasks/app-deps /app/tasks/app-deps
RUN make app-deps

COPY . /app
RUN /app/configure && make && \
rm -rf /build/build/work/src/api-umbrella-core/tmp/admin-ui-build/node_modules/*/.node_modules.ember-try
RUN make

RUN rm -rf build/work/tasks

FROM ubuntu:16.04

COPY --from=build /app /app
COPY --from=build /build /build
RUN env INSTALL_TEST_DEPENDENCIES=true /app/tasks/install-system-build-dependencies
WORKDIR /app

RUN groupadd -r api-umbrella && \
useradd -r -g api-umbrella -s /sbin/nologin -d /opt/api-umbrella -c "API Umbrella user" api-umbrella

ENV PATH "/app/bin:/build/build/work/dev-env/sbin:/build/build/work/dev-env/bin:/build/build/work/test-env/sbin:/build/build/work/test-env/bin:/build/build/work/stage/opt/api-umbrella/sbin:/build/build/work/stage/opt/api-umbrella/bin:/build/build/work/stage/opt/api-umbrella/embedded/sbin:/build/build/work/stage/opt/api-umbrella/embedded/bin:${PATH}"
ENV API_UMBRELLA_ROOT /build/build/work/stage/opt/api-umbrella

WORKDIR /app

ENTRYPOINT ["/app/docker/dev/docker-entrypoint"]
CMD ["/app/docker/dev/docker-start"]
25 changes: 25 additions & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# A minimal Makefile that downloads the "task" tool and passes things off to
# that tool for executing (so "make all" actually becomes "task all"). See
# Taskfile.yml for more detail.

ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
WORK_DIR:=$(ROOT_DIR)/build/work

prefix = @prefix@
export PREFIX=$(prefix)

.PHONY: default task-passthrough
default: all

# Download and locally install the "task" tool.
TASK_VERSION:=2.0.2
$(ROOT_DIR)/tasks/bootstrap-$(TASK_VERSION): ;
$(WORK_DIR)/stamp/bootstrap-$(TASK_VERSION): $(ROOT_DIR)/tasks/bootstrap-$(TASK_VERSION)
$(ROOT_DIR)/tasks/bootstrap-$(TASK_VERSION)

task-passthrough: $(WORK_DIR)/stamp/bootstrap-$(TASK_VERSION)
$(WORK_DIR)/task $(MAKECMDGOALS)

# Match all commands sent to "make" and send them to "task" instead.
%: task-passthrough
@true
3 changes: 1 addition & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ ENV["PATH"] = [
"#{API_UMBRELLA_SRC_ROOT}/build/work/test-env/sbin",
"#{API_UMBRELLA_SRC_ROOT}/build/work/dev-env/bin",
"#{API_UMBRELLA_SRC_ROOT}/build/work/dev-env/sbin",
"#{API_UMBRELLA_SRC_ROOT}/build/work/cmake/bin",
ENV["PATH"],
].join(":")

Dir.glob(File.join(API_UMBRELLA_SRC_ROOT, "scripts/rake/*.rake")).each { |r| import r }

task(:default).clear
task(:default => [:lint, :test])
task(:default => [:test])
Loading