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

Optimtize installs #3

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 21 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: pull request snapshot build
on:
pull_request:
branches:
- master

jobs:
build:
name: Build Docker Image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Build Snapshot & Publish to Registry
uses: jen20/action-docker-build@v1
with:
repository: docker.pkg.github.com/pulumi/pulumi-build-container/pulumi-build-container
buildkit: true
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
tag-snapshot: true
registry: https://docker.pkg.github.com
16 changes: 8 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,25 @@ RUN --mount=target=/build-scripts,type=bind,source=scripts \

# Install Go compiler and linter
RUN --mount=target=/build-scripts,type=bind,source=scripts \
GOLANG_VERSION=1.14 \
GOLANG_SHA256=08df79b46b0adf498ea9f320a0f23d6ec59e9003660b4c9c1ce8e5e2c6f823ca \
GOLANGCI_LINT_VERSION=1.18.0 \
GOLANG_VERSION=1.13.10 \
GOLANG_SHA256=8a4cbc9f2b95d114c38f6cbe94a45372d48c604b707db2057c787398dfbf8e7f \
GOLANGCI_LINT_VERSION=1.23.8 \
/build-scripts/install-go.sh

# Install Node.js and Yarn
RUN --mount=target=/build-scripts,type=bind,source=scripts \
--mount=target=/var/lib/apt/lists,type=cache \
--mount=target=/var/cache/apt,type=cache \
NODE_VERSION=10.x \
NODE_VERSION=12.x \
NODE_DISTRO=bionic \
YARN_VERSION=1.21.1 \
YARN_VERSION=1.22.4 \
/build-scripts/install-node.sh

# Install Python and accoutrements
RUN --mount=target=/build-scripts,type=bind,source=scripts \
--mount=target=/var/lib/apt/lists,type=cache \
--mount=target=/var/cache/apt,type=cache \
PYTHON_VERSION=3.7 \
PYTHON_VERSION=3.8 \
PIPENV_VERSION=2018.11.26 \
AWSCLI_VERSION=1.17.9 \
WHEEL_VERSION=0.34.2 \
Expand All @@ -57,8 +57,8 @@ RUN --mount=target=/build-scripts,type=bind,source=scripts \

# Install Pulumi build tools
RUN --mount=target=/build-scripts,type=bind,source=scripts \
TF2PULUMI_VERSION=0.6.0 \
TF2PULUMI_SHA256=9a8fdfc590f8813a5ccaf1bfb1abba3064f109cce34f47fc66a34adaaa44c50f \
TF2PULUMI_VERSION=0.8.0 \
TF2PULUMI_SHA256=0019dfc4b32d63c1392aa264aed2253c1e0c2fb09216f8e2cc269bbfb8bb49b5 \
/build-scripts/install-pulumi-tools.sh

# Set various required environment variables
Expand Down
2 changes: 1 addition & 1 deletion scripts/install-dotnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ rm packages-microsoft-prod.deb

apt-get update

apt-get install -y \
apt-get install --no-install-recommends -y \
"dotnet-sdk-${DOTNET_SDK_VERSION}" \
"aspnetcore-runtime-${DOTNET_SDK_VERSION}"
2 changes: 1 addition & 1 deletion scripts/install-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ echo "deb https://deb.nodesource.com/${NODE_REPO} ${NODE_DISTRO} main" > /etc/ap
echo "deb-src https://deb.nodesource.com/${NODE_REPO} ${NODE_DISTRO} main" >> /etc/apt/sources.list.d/nodesource.list

apt-get update
apt-get install -y nodejs
apt-get install -y nodejs --no-install-recommends

curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version "${YARN_VERSION}"
4 changes: 4 additions & 0 deletions scripts/install-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ set -o errexit
set -o pipefail
set -o xtrace

# Reduce apt deps
echo 'APT::Install-Recommends "0";' >> /etc/apt/apt.conf
echo 'APT::Install-Suggests "0";' >> /etc/apt/apt.conf

SCRIPT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null 2>&1 && pwd)"
#shellcheck source=utils.sh
source "${SCRIPT_ROOT}/utils.sh"
Expand Down
2 changes: 2 additions & 0 deletions scripts/install-protobuf-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ GOBIN=/usr/local/bin /usr/local/go/bin/go install github.com/golang/protobuf/pro
popd
rm -rf /tmp/protobuf

# See https://github.com/grpc/grpc-node/issues/922#issuecomment-610972948 for why
npm install --unsafe-perm -g [email protected]
# Install Node gRPC Tools
npm install --unsafe-perm -g "grpc@${NODEJS_GRPC_VERSION}" "grpc-tools@${NODEJS_GRPC_TOOLS_VERSION}"

Expand Down
8 changes: 4 additions & 4 deletions scripts/install-python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ ensureSet "${TWINE_VERSION}" "TWINE_VERSION" || exit 1
export DEBIAN_FRONTEND=noninteractive

apt-get update
apt-get install -y "python${PYTHON_VERSION}" python3-pip
apt-get install -y "python${PYTHON_VERSION}" python3-pip python3-setuptools --no-install-recommends
update-alternatives --install /usr/bin/python3 python3 "/usr/bin/python${PYTHON_VERSION}" 1
python3 --version

pip3 install --user "pipenv==${PIPENV_VERSION}"
pip3 install --user "awscli==${AWSCLI_VERSION}"
pip3 install --user "wheel==${WHEEL_VERSION}" "twine==${TWINE_VERSION}"
pip3 install --no-cache --user "pipenv==${PIPENV_VERSION}"
pip3 install --no-cache --user "awscli==${AWSCLI_VERSION}"
pip3 install --no-cache --user "wheel==${WHEEL_VERSION}" "twine==${TWINE_VERSION}"