Skip to content
This repository has been archived by the owner on Aug 26, 2021. It is now read-only.

For historical builds #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

For historical builds #10

wants to merge 2 commits into from

Conversation

cheako
Copy link

@cheako cheako commented Mar 13, 2021

This provides a number of useful features:

  1. Upgrading dependencies is set as action dependant(this can be automated)
  2. Historical instances continue to build and work months or perhaps years out
    • Unlike today where newly discovered bugs could be introduced just because it's months after the commit was made
  3. Better identification of bugs in the upstream sources
    • Think of the effect this has on bisect

@cheako
Copy link
Author

cheako commented Mar 14, 2021

This ran for several hours and even though I'm using a commit that would have been current when the commit was made, I don't know if this was ever tested to work this way. Could have been I was just OOM.

ARG ETEBASE_TAG=master
ARG ETESYNC_WEB_TAG=master

ARG PUID=1000
ARG PGID=1000
ARG PORT=8080

# =============================================================================
# Build the EteSync web client.

FROM node:12 as web

ARG ETESYNC_WEB_TAG

ADD https://github.com/etesync/etesync-web/archive/${ETESYNC_WEB_TAG}.tar.gz etesync_web.tar.gz
ENV REACT_APP_DEFAULT_API_PATH "/"
RUN mkdir -p etesync-web \
 && tar xf etesync_web.tar.gz --strip-components=1 -C etesync-web \
 && cd etesync-web \
 && yarn --network-timeout 3600000 \
 && yarn build --network-timeout 3600000

# =============================================================================

FROM python:3.8-slim

ARG ETEBASE_TAG
ARG PUID
ARG PGID
ARG PORT

ENV ETEBASE_DIRECTORY "/opt/etebase"
ENV ETEBASE_DATA_DIRECTORY "/data"
ENV ETEBASE_MEDIA_DIRECTORY "/data/media"
ENV ETEBASE_DATABASE_FILE "db.sqlite3"
ENV ETEBASE_PORT ${PORT}

# Install uWSGI.
# Unfortunately this needs a compiler, so we install one for just this step. We also install
# libpcre3 to enable internal routing in uWSGI.
RUN apt-get update \
 && apt-get install -y build-essential python3-dev libpcre3-dev \
 && pip3 install uwsgi \
 && pip3 cache purge \
 && apt-get purge -y --auto-remove build-essential python3-dev libpcre3-dev \
 && rm -rf /var/lib/apt/lists/*

# Download Etebase.
ADD https://github.com/etesync/server/archive/${ETEBASE_TAG}.tar.gz etebase.tar.gz
RUN mkdir -p ${ETEBASE_DIRECTORY} \
 && tar xf etebase.tar.gz --strip-components=1 --exclude="example-configs" -C ${ETEBASE_DIRECTORY} \
 && rm etebase.tar.gz \
 && pip3 install --no-cache-dir -r ${ETEBASE_DIRECTORY}/requirements.txt \
 && ${ETEBASE_DIRECTORY}/manage.py collectstatic

# Copy the web client from the other build stage.
COPY --from=web /etesync-web/build ${ETEBASE_DIRECTORY}/web

# Create a user as which the server will run.
RUN groupadd --gid ${PGID} etebase \
 && useradd --uid ${PUID} --gid etebase --shell /bin/bash etebase

# Copy configuration files and startup script.
COPY config/etebase_server_settings.py ${ETEBASE_DIRECTORY}/etebase_server_settings.py
COPY config/uwsgi.ini /etc/uwsgi/
COPY scripts/init.sh /

VOLUME ${ETEBASE_DATA_DIRECTORY}
EXPOSE ${ETEBASE_PORT}
USER ${PUID}:${PGID}

CMD ["/init.sh"]
root@olympus:~/src/docker-etesync# docker build --build-arg ETEBASE_TAG=057b908565072bf9b1003410c0080f42294d446a -t ete .
Sending build context to Docker daemon  165.4kB
Step 1/32 : ARG ETEBASE_TAG=master
Step 2/32 : ARG ETESYNC_WEB_TAG=master
Step 3/32 : ARG PUID=1000
Step 4/32 : ARG PGID=1000
Step 5/32 : ARG PORT=8080
Step 6/32 : FROM node:12 as web
 ---> 6eebb917214a
Step 7/32 : ARG ETESYNC_WEB_TAG
 ---> Using cache
 ---> 89d99812af00
Step 8/32 : ADD https://github.com/etesync/etesync-web/archive/${ETESYNC_WEB_TAG}.tar.gz etesync_web.tar.gz
Downloading  352.7kB

 ---> Using cache
 ---> 7a203780407c
Step 9/32 : ENV REACT_APP_DEFAULT_API_PATH "/"
 ---> Using cache
 ---> a2e1e229d52f
Step 10/32 : RUN mkdir -p etesync-web  && tar xf etesync_web.tar.gz --strip-components=1 -C etesync-web  && cd etesync-web  && yarn --network-timeout 3600000  && yarn build --network-timeout 3600000
 ---> Running in 5b781b0cf91d
yarn install v1.22.5
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@2.1.2: The platform "linux" is incompatible with this module.
info "fsevents@2.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@1.2.13: The platform "linux" is incompatible with this module.
info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@2.1.3: The platform "linux" is incompatible with this module.
info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > @material-ui/pickers@3.2.10" has unmet peer dependency "@date-io/core@^1.3.6".
warning " > @material-ui/pickers@3.2.10" has unmet peer dependency "prop-types@^15.6.0".
warning " > @testing-library/user-event@7.2.1" has unmet peer dependency "@testing-library/dom@>=5".
Done in 6548.23s.
yarn run v1.22.5
$ react-scripts build --network-timeout 3600000
Creating an optimized production build...
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

@cheako cheako force-pushed the use-refs branch 3 times, most recently from 370cd46 to 4e0d2c5 Compare March 14, 2021 12:44
These IDs have been tested and would have been current back in Dec 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant