19 Commits

Author SHA1 Message Date
Christopher Hoskin
a47237ccb7 Explicitly start build immediately 2019-10-25 16:54:36 +01:00
Christopher Hoskin
ab82140128 Try some parallelism 2019-10-25 16:42:33 +01:00
Christopher Hoskin
4d81b2ca53 Another go at printing out times 2019-10-25 11:55:57 +01:00
Christopher Hoskin
c1eca448c5 Need bash for pipefail 2019-10-25 11:21:24 +01:00
Christopher Hoskin
d04df4ed75 Try to get more times 2019-10-25 10:42:21 +01:00
Christopher Hoskin
d9f487efc4 Remove bin/install_texlive_gce.sh 2019-10-25 10:10:14 +01:00
Christopher Hoskin
02b5cc8efd Revert "Remove TEXLIVE_IMAGE env var - expect failure"
This reverts commit 3ab407b91a.
2019-10-24 17:08:43 +01:00
Christopher Hoskin
f3c6756294 Try to narrow down where the delay is 2019-10-24 14:52:28 +01:00
Christopher Hoskin
3ab407b91a Remove TEXLIVE_IMAGE env var - expect failure 2019-10-24 12:13:29 +01:00
Christopher Hoskin
0b40c8f79d Try a different texlive image 2019-10-24 10:58:04 +01:00
Christopher Hoskin
882732d6a5 Try build on bigger machine 2019-10-23 21:42:09 +01:00
Christopher Hoskin
d934f96370 Increase timeout 2019-10-23 19:03:15 +01:00
Christopher Hoskin
0f84c47bbe Try again with gcr texlive image 2019-10-23 17:08:13 +01:00
Christopher Hoskin
fdd87d77cc Try env pass-through 2019-10-23 16:35:59 +01:00
Christopher Hoskin
7ebc9b43a1 Bump buildscript to 1.1.22 2019-10-23 16:28:23 +01:00
Christopher Hoskin
4c4dd64ca6 Try again 2019-10-23 14:31:15 +01:00
Christopher Hoskin
693b9e6193 Use gcr.io texlive image 2019-10-23 14:26:37 +01:00
Christopher Hoskin
65d416ee10 Add quay.io/sharelatex/texlive-full:2017.1 as a custom builder 2019-10-23 12:03:11 +01:00
Christopher Hoskin
8f70dbd67b Start trying to figure out CLSI cloudbuild 2019-10-23 12:00:15 +01:00
9 changed files with 81 additions and 49 deletions

View File

@@ -14,10 +14,14 @@ RUN npm run compile:all
FROM node:10.15.0
RUN \
apt -y update && \
apt -y install moreutils
COPY --from=app /app /app
WORKDIR /app
RUN chmod 0755 ./install_deps.sh && ./install_deps.sh
ENTRYPOINT ["/bin/sh", "entrypoint.sh"]
ENTRYPOINT ["/bin/bash", "entrypoint.sh"]
CMD ["node", "--expose-gc", "app.js"]

View File

@@ -1,7 +1,7 @@
# This file was auto-generated, do not edit it directly.
# Instead run bin/update_build_scripts from
# https://github.com/sharelatex/sharelatex-dev-environment
# Version: 1.1.21
# Version: 1.1.22
BUILD_NUMBER ?= local
BRANCH_NAME ?= $(shell git rev-parse --abbrev-ref HEAD)
@@ -35,7 +35,7 @@ test_clean:
$(DOCKER_COMPOSE) down -v -t 0
test_acceptance_pre_run:
@[ ! -f test/acceptance/scripts/pre-run ] && echo "clsi has no pre acceptance tests task" || $(DOCKER_COMPOSE) run --rm test_acceptance test/acceptance/scripts/pre-run
@[ ! -f test/acceptance/js/scripts/pre-run ] && echo "clsi has no pre acceptance tests task" || $(DOCKER_COMPOSE) run --rm test_acceptance test/acceptance/js/scripts/pre-run
build:
docker build --pull --tag ci/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER) \
--tag gcr.io/overleaf-ops/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER) \

View File

@@ -1,21 +0,0 @@
#!/bin/sh
METADATA=http://metadata.google.internal./computeMetadata/v1
SVC_ACCT=$METADATA/instance/service-accounts/default
PROJECT_URL=$METADATA/project/project-id
ACCESS_TOKEN=$(curl -s -H 'Metadata-Flavor: Google' $SVC_ACCT/token | cut -d'"' -f 4)
if [ -z "$ACCESS_TOKEN" ]; then
echo "No acccess token to download texlive-full images from google container, continuing without downloading. This is likely not a google cloud enviroment."
exit 0
fi
PROJECT=$(curl -s -H 'Metadata-Flavor: Google' $PROJECT_URL)
if [ -z "$PROJECT" ]; then
echo "No project name to download texlive-full images from google container, continuing without downloading. This is likely not a google cloud enviroment."
exit 0
fi
docker login -u '_token' -p $ACCESS_TOKEN https://gcr.io
docker pull --all-tags gcr.io/$PROJECT/texlive-full
cp /app/bin/synctex /app/bin/synctex-mount/synctex
echo "Finished downloading texlive-full images"

View File

@@ -4,5 +4,6 @@ clsi
--acceptance-creds=None
--dependencies=mongo,redis
--docker-repos=gcr.io/overleaf-ops
--env-pass-through=TEXLIVE_IMAGE
--build-target=docker
--script-version=1.1.21
--script-version=1.1.22

39
cloudbuild.yaml Normal file
View File

@@ -0,0 +1,39 @@
steps:
- id: texlive
name: 'gcr.io/overleaf-ops/texlive-full:2017.1'
- id: build
name: 'gcr.io/overleaf-ops/cloud-builder'
args:
- 'build'
env:
- 'BUILD_NUMBER=$SHORT_SHA'
- 'BRANCH_NAME=$BRANCH_NAME'
waitFor: ['-']
- id: test_unit
name: 'gcr.io/overleaf-ops/cloud-builder'
args:
- 'test_unit'
env:
- 'DOCKER_COMPOSE_FLAGS=-f docker-compose.ci.yml'
- 'BUILD_NUMBER=$SHORT_SHA'
- 'BRANCH_NAME=$BRANCH_NAME'
waitFor:
- build
- id: test_acceptance
name: 'gcr.io/overleaf-ops/cloud-builder'
args:
- 'test_acceptance'
env:
- 'DOCKER_COMPOSE_FLAGS=-f docker-compose.ci.yml'
- 'BUILD_NUMBER=$SHORT_SHA'
- 'BRANCH_NAME=$BRANCH_NAME'
- 'TEXLIVE_IMAGE=gcr.io/overleaf-ops/texlive-full:2017.1'
waitFor:
- build
- texlive
images:
- 'gcr.io/$PROJECT_ID/clsi:${BRANCH_NAME}-${SHORT_SHA}'
timeout: 1800s
options:
diskSizeGb: 200
machineType: 'N1_HIGHCPU_8'

View File

@@ -1,7 +1,7 @@
# This file was auto-generated, do not edit it directly.
# Instead run bin/update_build_scripts from
# https://github.com/sharelatex/sharelatex-dev-environment
# Version: 1.1.21
# Version: 1.1.22
version: "2"
@@ -26,6 +26,7 @@ services:
POSTGRES_HOST: postgres
MOCHA_GREP: ${MOCHA_GREP}
NODE_ENV: test
TEXLIVE_IMAGE:
depends_on:
- mongo
- redis

View File

@@ -1,7 +1,7 @@
# This file was auto-generated, do not edit it directly.
# Instead run bin/update_build_scripts from
# https://github.com/sharelatex/sharelatex-dev-environment
# Version: 1.1.21
# Version: 1.1.22
version: "2"

25
entrypoint.sh Executable file → Normal file
View File

@@ -1,25 +1,6 @@
#!/bin/sh
#!/bin/bash
echo "Changing permissions of /var/run/docker.sock for sibling containers"
ls -al /var/run/docker.sock
docker --version
cat /etc/passwd
set -o pipefail
DOCKER_GROUP=$(stat -c '%g' /var/run/docker.sock)
groupadd --non-unique --gid ${DOCKER_GROUP} dockeronhost
usermod -aG dockeronhost node
/app/inner-entrypoint.sh "$@" 2>&1 | ts
mkdir -p /app/cache
chown -R node:node /app/cache
mkdir -p /app/compiles
chown -R node:node /app/compiles
chown -R node:node /app/bin/synctex
mkdir -p /app/test/acceptance/fixtures/tmp/
chown -R node:node /app
chown -R node:node /app/bin
./bin/install_texlive_gce.sh
exec runuser -u node -- "$@"

27
inner-entrypoint.sh Executable file
View File

@@ -0,0 +1,27 @@
#!/bin/sh
set -x
date
echo "Changing permissions of /var/run/docker.sock for sibling containers"
ls -al /var/run/docker.sock
docker --version
cat /etc/passwd
DOCKER_GROUP=$(stat -c '%g' /var/run/docker.sock)
groupadd --non-unique --gid ${DOCKER_GROUP} dockeronhost
usermod -aG dockeronhost node
mkdir -p /app/cache
chown -R node:node /app/cache
mkdir -p /app/compiles
chown -R node:node /app/compiles
chown -R node:node /app/bin/synctex
mkdir -p /app/test/acceptance/fixtures/tmp/
chown -R node:node /app
chown -R node:node /app/bin
exec runuser -u node -- "$@"