-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improvement, seed: reduce size of seed containers and speed up python…
… and java tests (#3011) * update python * update java and ts too * eslint Dockerfiles * ignore literal for fastapi * update .fernignore * publish containers * try again * try publishing again * retry * try agin * clone repo * fix * update python and java image dep * run yarn build after yarn install * Update build-seed.yml * Update Dockerfile.python * try installing xz * Update Dockerfile.python * Update build-seed.yml * Update testWorkspaceFixtures.ts * update java model too and see if reducing parallelism helps get it to local * run when this file is updated * Update seed.yml * Update seed.yml * Update seed.yml * updates should work * more files * republish python-seed * update allowed failures and get seed to green * fix ruby sdk * fix java sdk --------- Co-authored-by: dsinghvi <[email protected]>
- Loading branch information
1 parent
7ef4466
commit 953a306
Showing
129 changed files
with
8,762 additions
and
698 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,4 @@ packages/ir-sdk/** | |
packages/seed/** | ||
generators/typescript/utils/core-utilities/** | ||
seed/** | ||
|
||
docker/seed/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: Build seed containers | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
# Cancel previous workflows on previous push | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
changes: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
packages: ${{ steps.filter.outputs.changes }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: dorny/paths-filter@v2 | ||
id: filter | ||
with: | ||
filters: | | ||
python: | ||
- 'docker/seed/Dockerfile.python' | ||
- 'generators/python/poetry.lock' | ||
- '.github/workflows/build-seed.yml' | ||
ts: | ||
- 'docker/seed/Dockerfile.ts' | ||
- '.github/workflows/build-seed.yml' | ||
java: | ||
- 'docker/seed/Dockerfile.java' | ||
- '.github/workflows/build-seed.yml' | ||
build-container: | ||
strategy: | ||
matrix: | ||
# Parse JSON array containing names of all filters matching any of changed files | ||
# e.g. ['package1', 'package2'] if both package folders contains changes | ||
package: ${{ fromJSON(needs.changes.outputs.packages) }} | ||
runs-on: ubuntu-latest | ||
needs: changes | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: fernapi | ||
password: ${{ secrets.FERN_API_DOCKERHUB_PASSWORD }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: fernapi/${{ matrix.package }}-seed | ||
tags: | | ||
type=sha | ||
latest | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: ./docker/seed/Dockerfile.${{ matrix.package }} | ||
push: true | ||
# use short SHA if modded, or just use latest if nothing changed | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Small ubuntu base image | ||
FROM redhat/ubi9:latest | ||
|
||
# Install sdkman | ||
RUN yum update -y | ||
RUN yum -y install git zip unzip | ||
RUN git clone https://github.com/jenv/jenv.git ~/.jenv | ||
RUN echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.bash_profile | ||
RUN echo 'eval "$(jenv init -)"' >> ~/.bash_profile | ||
RUN source ~/.bash_profile | ||
|
||
RUN set -eux; \ | ||
ARCH="$(uname -m)"; \ | ||
case "${ARCH}" in \ | ||
aarch64|arm64) \ | ||
BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u292-b10/OpenJDK8U-jdk_aarch64_linux_hotspot_8u292b10.tar.gz'; \ | ||
;; \ | ||
amd64|x86_64) \ | ||
BINARY_URL='https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u292-b10/OpenJDK8U-jdk_x64_linux_hotspot_8u292b10.tar.gz'; \ | ||
;; \ | ||
*) \ | ||
echo "Unsupported arch: ${ARCH}"; \ | ||
exit 1; \ | ||
;; \ | ||
esac; \ | ||
curl -LfsSo /tmp/openjdk.tar.gz ${BINARY_URL}; \ | ||
mkdir -p /opt/java/openjdk8; \ | ||
cd /opt/java/openjdk8; \ | ||
tar -xf /tmp/openjdk.tar.gz --strip-components=1; \ | ||
rm -rf /tmp/openjdk.tar.gz; | ||
|
||
RUN source ~/.bash_profile && jenv add /opt/java/openjdk8 | ||
|
||
RUN set -eux; \ | ||
ARCH="$(uname -m)"; \ | ||
case "${ARCH}" in \ | ||
aarch64|arm64) \ | ||
BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.9.1%2B1/OpenJDK11U-jdk_aarch64_linux_hotspot_11.0.9.1_1.tar.gz'; \ | ||
;; \ | ||
amd64|x86_64) \ | ||
BINARY_URL='https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.9.1%2B1/OpenJDK11U-jdk_x64_linux_hotspot_11.0.9.1_1.tar.gz'; \ | ||
;; \ | ||
*) \ | ||
echo "Unsupported arch: ${ARCH}"; \ | ||
exit 1; \ | ||
;; \ | ||
esac; \ | ||
curl -LfsSo /tmp/openjdk.tar.gz ${BINARY_URL}; \ | ||
mkdir -p /opt/java/openjdk11; \ | ||
cd /opt/java/openjdk11; \ | ||
tar -xf /tmp/openjdk.tar.gz --strip-components=1; \ | ||
rm -rf /tmp/openjdk.tar.gz; | ||
|
||
RUN source ~/.bash_profile && jenv add /opt/java/openjdk11 | ||
RUN source ~/.bash_profile && jenv global 11 | ||
RUN source ~/.bash_profile && jenv enable-plugin export | ||
RUN source ~/.bash_profile && jenv enable-plugin gradle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Small ubuntu base image | ||
FROM redhat/ubi9:latest | ||
|
||
# Setup the environment, can run pytest, poetry install, etc. | ||
COPY seed/python-sdk/imdb/pyproject.toml ./pyproject.toml | ||
COPY seed/python-sdk/imdb/poetry.lock ./poetry.lock | ||
COPY seed/python-sdk/imdb/src ./src | ||
|
||
# Setup pyenv | ||
RUN yum update -y | ||
RUN yum -y install git gcc zlib-devel openssl-devel xz-devel | ||
RUN git clone --depth=1 https://github.com/pyenv/pyenv.git .pyenv | ||
ENV PYENV_ROOT="${HOME}/.pyenv" | ||
ENV PATH="${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${PATH}" | ||
RUN eval "$(pyenv init --path)" | ||
|
||
RUN pyenv install 3.9 || true | ||
RUN pyenv install 3.8 || true | ||
|
||
# Setup poetry | ||
RUN pyenv global 3.9 | ||
RUN pip install poetry &&\ | ||
poetry config virtualenvs.create false &&\ | ||
poetry install | ||
RUN pip install mypy==1.8.0 | ||
|
||
# Setup poetry | ||
RUN pyenv global 3.8 | ||
RUN pip install poetry &&\ | ||
poetry config virtualenvs.create false &&\ | ||
poetry install | ||
RUN pip install mypy==1.8.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
FROM node:lts-slim | ||
|
||
# Installs tsc | ||
RUN npm install -g typescript |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.