From e5e9a897747d0435182e5b964ee95fd260d0ea93 Mon Sep 17 00:00:00 2001 From: Yair Siman Tov <63305203+yairsimantov20@users.noreply.github.com> Date: Fri, 11 Aug 2023 22:27:26 +0300 Subject: [PATCH] Port 4485 shrink ocean images (#68) shrunk ocean image size --- changelog/PORT-4485.improvement.md | 1 + integrations/gitlab/.dockerignore | 96 ++++++++++++++++++- integrations/gitlab/.port/spec.yaml | 2 +- integrations/gitlab/CHANGELOG.md | 8 ++ integrations/gitlab/Dockerfile | 11 +-- integrations/gitlab/Makefile | 6 +- integrations/gitlab/pyproject.toml | 2 +- integrations/jira/.dockerignore | 96 ++++++++++++++++++- integrations/jira/.port/spec.yaml | 2 +- integrations/jira/CHANGELOG.md | 7 ++ integrations/jira/Dockerfile | 11 +-- integrations/jira/pyproject.toml | 2 +- integrations/newrelic/.dockerignore | 96 ++++++++++++++++++- integrations/newrelic/.port/spec.yaml | 2 +- integrations/newrelic/CHANGELOG.md | 7 ++ integrations/newrelic/Dockerfile | 11 +-- integrations/newrelic/pyproject.toml | 2 +- integrations/pagerduty/.dockerignore | 96 ++++++++++++++++++- integrations/pagerduty/.port/spec.yaml | 2 +- integrations/pagerduty/CHANGELOG.md | 7 ++ integrations/pagerduty/Dockerfile | 11 +-- integrations/pagerduty/pyproject.toml | 2 +- .../.dockerignore | 96 ++++++++++++++++++- .../Dockerfile | 11 +-- 24 files changed, 528 insertions(+), 59 deletions(-) create mode 100644 changelog/PORT-4485.improvement.md diff --git a/changelog/PORT-4485.improvement.md b/changelog/PORT-4485.improvement.md new file mode 100644 index 0000000000..f4e796b985 --- /dev/null +++ b/changelog/PORT-4485.improvement.md @@ -0,0 +1 @@ +Optimized dockerfile to produce smaller images \ No newline at end of file diff --git a/integrations/gitlab/.dockerignore b/integrations/gitlab/.dockerignore index 2ceaf5c08d..dc28c4f316 100644 --- a/integrations/gitlab/.dockerignore +++ b/integrations/gitlab/.dockerignore @@ -1,6 +1,94 @@ -.vscode/ -assets/ -*.md +# Git .git .gitignore -.env \ No newline at end of file +.gitattributes + + +# CI +.codeclimate.yml +.travis.yml +.taskcluster.yml + +# Docker +docker-compose.yml +Dockerfile +.docker +.dockerignore + +# Byte-compiled / optimized / DLL files +**/__pycache__/ +**/*.py[cod] + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.cache +nosetests.xml +coverage.xml + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Virtual environment +.env +.venv/ +venv/ + +# PyCharm +.idea + +# Python mode for VIM +.ropeproject +**/.ropeproject + +# Vim swap files +**/*.swp + +# VS Code +.vscode/ + +*.md +**/.ruff_cache +**/cahangelog +**/tests \ No newline at end of file diff --git a/integrations/gitlab/.port/spec.yaml b/integrations/gitlab/.port/spec.yaml index 7f2883df2e..5f151965e0 100644 --- a/integrations/gitlab/.port/spec.yaml +++ b/integrations/gitlab/.port/spec.yaml @@ -1,4 +1,4 @@ -version: v0.1.7 +version: v0.1.8 type: gitlab description: Gitlab integration for Port Ocean icon: GitLab diff --git a/integrations/gitlab/CHANGELOG.md b/integrations/gitlab/CHANGELOG.md index acbb19befa..944d3c621f 100644 --- a/integrations/gitlab/CHANGELOG.md +++ b/integrations/gitlab/CHANGELOG.md @@ -7,6 +7,14 @@ this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm +0.1.8 (2023-08-11) +================== + +### Improvements + +- Optimized dockerfile to produce smaller images (PORT-4485) + + 0.1.7 (2023-08-11) ================== diff --git a/integrations/gitlab/Dockerfile b/integrations/gitlab/Dockerfile index cdb8b20ce9..1436f8b004 100644 --- a/integrations/gitlab/Dockerfile +++ b/integrations/gitlab/Dockerfile @@ -4,13 +4,12 @@ ENV LIBRDKAFKA_VERSION 1.9.2 WORKDIR /app -RUN apt update && apt install -y wget make g++ libssl-dev autoconf automake libtool curl -RUN wget https://github.com/edenhill/librdkafka/archive/v${LIBRDKAFKA_VERSION}.tar.gz && \ - tar xvzf v${LIBRDKAFKA_VERSION}.tar.gz && \ - (cd librdkafka-${LIBRDKAFKA_VERSION}/ && ./configure && make && make install && ldconfig) +RUN apt update && \ + apt install -y wget make g++ libssl-dev autoconf automake libtool curl librdkafka-dev && \ + apt-get clean COPY . /app -RUN make install +RUN export POETRY_VIRTUALENVS_CREATE=false && make install/prod && pip cache purge -ENTRYPOINT make run \ No newline at end of file +ENTRYPOINT ocean sail \ No newline at end of file diff --git a/integrations/gitlab/Makefile b/integrations/gitlab/Makefile index 399de69631..9a6067dc1f 100644 --- a/integrations/gitlab/Makefile +++ b/integrations/gitlab/Makefile @@ -38,13 +38,17 @@ define deactivate_virtualenv fi endef -.SILENT: install lint run test clean +.SILENT: install install/prod lint run test clean install: $(call deactivate_virtualenv) && \ $(call install_poetry) && \ poetry install --with dev +install/prod: + $(call install_poetry) && \ + poetry install --without dev --no-root --no-interaction --no-ansi --no-cache + lint: $(ACTIVATE) && \ $(call run_checks,.) diff --git a/integrations/gitlab/pyproject.toml b/integrations/gitlab/pyproject.toml index 5a5f307b32..88c9fa2d2c 100644 --- a/integrations/gitlab/pyproject.toml +++ b/integrations/gitlab/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "gitlab" -version = "0.1.7" +version = "0.1.8" description = "Gitlab integration for Port using Port-Ocean Framework" authors = ["Yair Siman-Tov "] diff --git a/integrations/jira/.dockerignore b/integrations/jira/.dockerignore index 2ceaf5c08d..dc28c4f316 100644 --- a/integrations/jira/.dockerignore +++ b/integrations/jira/.dockerignore @@ -1,6 +1,94 @@ -.vscode/ -assets/ -*.md +# Git .git .gitignore -.env \ No newline at end of file +.gitattributes + + +# CI +.codeclimate.yml +.travis.yml +.taskcluster.yml + +# Docker +docker-compose.yml +Dockerfile +.docker +.dockerignore + +# Byte-compiled / optimized / DLL files +**/__pycache__/ +**/*.py[cod] + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.cache +nosetests.xml +coverage.xml + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Virtual environment +.env +.venv/ +venv/ + +# PyCharm +.idea + +# Python mode for VIM +.ropeproject +**/.ropeproject + +# Vim swap files +**/*.swp + +# VS Code +.vscode/ + +*.md +**/.ruff_cache +**/cahangelog +**/tests \ No newline at end of file diff --git a/integrations/jira/.port/spec.yaml b/integrations/jira/.port/spec.yaml index 62a57abd65..93c4e3350b 100644 --- a/integrations/jira/.port/spec.yaml +++ b/integrations/jira/.port/spec.yaml @@ -1,4 +1,4 @@ -version: v0.1.1 +version: v0.1.2 type: jira description: Jira integration for Port Ocean icon: Jira diff --git a/integrations/jira/CHANGELOG.md b/integrations/jira/CHANGELOG.md index 68bb50c7ee..f0d7037d00 100644 --- a/integrations/jira/CHANGELOG.md +++ b/integrations/jira/CHANGELOG.md @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 +0.1.2 (2023-08-11) + +### Improvements + +- Optimized dockerfile to produce smaller images (PORT-4485) + + 0.1.1 (2023-08-11) ### Improvements diff --git a/integrations/jira/Dockerfile b/integrations/jira/Dockerfile index cdb8b20ce9..1436f8b004 100644 --- a/integrations/jira/Dockerfile +++ b/integrations/jira/Dockerfile @@ -4,13 +4,12 @@ ENV LIBRDKAFKA_VERSION 1.9.2 WORKDIR /app -RUN apt update && apt install -y wget make g++ libssl-dev autoconf automake libtool curl -RUN wget https://github.com/edenhill/librdkafka/archive/v${LIBRDKAFKA_VERSION}.tar.gz && \ - tar xvzf v${LIBRDKAFKA_VERSION}.tar.gz && \ - (cd librdkafka-${LIBRDKAFKA_VERSION}/ && ./configure && make && make install && ldconfig) +RUN apt update && \ + apt install -y wget make g++ libssl-dev autoconf automake libtool curl librdkafka-dev && \ + apt-get clean COPY . /app -RUN make install +RUN export POETRY_VIRTUALENVS_CREATE=false && make install/prod && pip cache purge -ENTRYPOINT make run \ No newline at end of file +ENTRYPOINT ocean sail \ No newline at end of file diff --git a/integrations/jira/pyproject.toml b/integrations/jira/pyproject.toml index 0aba65e4c4..392fa69282 100644 --- a/integrations/jira/pyproject.toml +++ b/integrations/jira/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "Jira" -version = "0.1.1" +version = "0.1.2" description = "Integration to bring information from Jira into Port" authors = ["Mor Paz "] diff --git a/integrations/newrelic/.dockerignore b/integrations/newrelic/.dockerignore index 2ceaf5c08d..dc28c4f316 100644 --- a/integrations/newrelic/.dockerignore +++ b/integrations/newrelic/.dockerignore @@ -1,6 +1,94 @@ -.vscode/ -assets/ -*.md +# Git .git .gitignore -.env \ No newline at end of file +.gitattributes + + +# CI +.codeclimate.yml +.travis.yml +.taskcluster.yml + +# Docker +docker-compose.yml +Dockerfile +.docker +.dockerignore + +# Byte-compiled / optimized / DLL files +**/__pycache__/ +**/*.py[cod] + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.cache +nosetests.xml +coverage.xml + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Virtual environment +.env +.venv/ +venv/ + +# PyCharm +.idea + +# Python mode for VIM +.ropeproject +**/.ropeproject + +# Vim swap files +**/*.swp + +# VS Code +.vscode/ + +*.md +**/.ruff_cache +**/cahangelog +**/tests \ No newline at end of file diff --git a/integrations/newrelic/.port/spec.yaml b/integrations/newrelic/.port/spec.yaml index 005a932dee..534d8aeb76 100644 --- a/integrations/newrelic/.port/spec.yaml +++ b/integrations/newrelic/.port/spec.yaml @@ -1,4 +1,4 @@ -version: v0.1.1 +version: v0.1.2 type: newrelic description: newrelic integration for Port Ocean icon: NewRelic diff --git a/integrations/newrelic/CHANGELOG.md b/integrations/newrelic/CHANGELOG.md index ed7ccb48a6..56047040e0 100644 --- a/integrations/newrelic/CHANGELOG.md +++ b/integrations/newrelic/CHANGELOG.md @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 +# Port_Ocean 0.1.2 (2023-08-11) + +### Improvements + +- Optimized dockerfile to produce smaller images (PORT-4485) + + 0.1.1 (2023-08-03) ================== diff --git a/integrations/newrelic/Dockerfile b/integrations/newrelic/Dockerfile index cdb8b20ce9..1436f8b004 100644 --- a/integrations/newrelic/Dockerfile +++ b/integrations/newrelic/Dockerfile @@ -4,13 +4,12 @@ ENV LIBRDKAFKA_VERSION 1.9.2 WORKDIR /app -RUN apt update && apt install -y wget make g++ libssl-dev autoconf automake libtool curl -RUN wget https://github.com/edenhill/librdkafka/archive/v${LIBRDKAFKA_VERSION}.tar.gz && \ - tar xvzf v${LIBRDKAFKA_VERSION}.tar.gz && \ - (cd librdkafka-${LIBRDKAFKA_VERSION}/ && ./configure && make && make install && ldconfig) +RUN apt update && \ + apt install -y wget make g++ libssl-dev autoconf automake libtool curl librdkafka-dev && \ + apt-get clean COPY . /app -RUN make install +RUN export POETRY_VIRTUALENVS_CREATE=false && make install/prod && pip cache purge -ENTRYPOINT make run \ No newline at end of file +ENTRYPOINT ocean sail \ No newline at end of file diff --git a/integrations/newrelic/pyproject.toml b/integrations/newrelic/pyproject.toml index c31c4a5416..9dc3aa7f2a 100644 --- a/integrations/newrelic/pyproject.toml +++ b/integrations/newrelic/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "newrelic" -version = "0.1.0" +version = "0.1.2" description = "New Relic Integration" authors = ["Tom Tankilevitch "] diff --git a/integrations/pagerduty/.dockerignore b/integrations/pagerduty/.dockerignore index 2ceaf5c08d..dc28c4f316 100644 --- a/integrations/pagerduty/.dockerignore +++ b/integrations/pagerduty/.dockerignore @@ -1,6 +1,94 @@ -.vscode/ -assets/ -*.md +# Git .git .gitignore -.env \ No newline at end of file +.gitattributes + + +# CI +.codeclimate.yml +.travis.yml +.taskcluster.yml + +# Docker +docker-compose.yml +Dockerfile +.docker +.dockerignore + +# Byte-compiled / optimized / DLL files +**/__pycache__/ +**/*.py[cod] + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.cache +nosetests.xml +coverage.xml + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Virtual environment +.env +.venv/ +venv/ + +# PyCharm +.idea + +# Python mode for VIM +.ropeproject +**/.ropeproject + +# Vim swap files +**/*.swp + +# VS Code +.vscode/ + +*.md +**/.ruff_cache +**/cahangelog +**/tests \ No newline at end of file diff --git a/integrations/pagerduty/.port/spec.yaml b/integrations/pagerduty/.port/spec.yaml index c2cc50d18f..a870563ef3 100644 --- a/integrations/pagerduty/.port/spec.yaml +++ b/integrations/pagerduty/.port/spec.yaml @@ -1,4 +1,4 @@ -version: v0.1.3 +version: v0.1.4 type: pagerduty description: pagerduty integration for Port Ocean icon: pagerduty diff --git a/integrations/pagerduty/CHANGELOG.md b/integrations/pagerduty/CHANGELOG.md index 9d3a712633..68423bc04b 100644 --- a/integrations/pagerduty/CHANGELOG.md +++ b/integrations/pagerduty/CHANGELOG.md @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 +# Port_Ocean 0.1.4 (2023-08-11) + +### Improvements + +- Optimized dockerfile to produce smaller images (PORT-4485) + + # Port_Ocean 0.1.3 (2023-08-11) ### Improvements diff --git a/integrations/pagerduty/Dockerfile b/integrations/pagerduty/Dockerfile index cdb8b20ce9..1436f8b004 100644 --- a/integrations/pagerduty/Dockerfile +++ b/integrations/pagerduty/Dockerfile @@ -4,13 +4,12 @@ ENV LIBRDKAFKA_VERSION 1.9.2 WORKDIR /app -RUN apt update && apt install -y wget make g++ libssl-dev autoconf automake libtool curl -RUN wget https://github.com/edenhill/librdkafka/archive/v${LIBRDKAFKA_VERSION}.tar.gz && \ - tar xvzf v${LIBRDKAFKA_VERSION}.tar.gz && \ - (cd librdkafka-${LIBRDKAFKA_VERSION}/ && ./configure && make && make install && ldconfig) +RUN apt update && \ + apt install -y wget make g++ libssl-dev autoconf automake libtool curl librdkafka-dev && \ + apt-get clean COPY . /app -RUN make install +RUN export POETRY_VIRTUALENVS_CREATE=false && make install/prod && pip cache purge -ENTRYPOINT make run \ No newline at end of file +ENTRYPOINT ocean sail \ No newline at end of file diff --git a/integrations/pagerduty/pyproject.toml b/integrations/pagerduty/pyproject.toml index 2ff7e7f1f8..903f563913 100644 --- a/integrations/pagerduty/pyproject.toml +++ b/integrations/pagerduty/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pagerduty" -version = "0.1.3" +version = "0.1.4" description = "Pagerduty Integration" authors = ["Port Team "] diff --git a/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.dockerignore b/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.dockerignore index 2ceaf5c08d..dc28c4f316 100644 --- a/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.dockerignore +++ b/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.dockerignore @@ -1,6 +1,94 @@ -.vscode/ -assets/ -*.md +# Git .git .gitignore -.env \ No newline at end of file +.gitattributes + + +# CI +.codeclimate.yml +.travis.yml +.taskcluster.yml + +# Docker +docker-compose.yml +Dockerfile +.docker +.dockerignore + +# Byte-compiled / optimized / DLL files +**/__pycache__/ +**/*.py[cod] + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.cache +nosetests.xml +coverage.xml + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Virtual environment +.env +.venv/ +venv/ + +# PyCharm +.idea + +# Python mode for VIM +.ropeproject +**/.ropeproject + +# Vim swap files +**/*.swp + +# VS Code +.vscode/ + +*.md +**/.ruff_cache +**/cahangelog +**/tests \ No newline at end of file diff --git a/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/Dockerfile b/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/Dockerfile index cdb8b20ce9..1436f8b004 100644 --- a/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/Dockerfile +++ b/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/Dockerfile @@ -4,13 +4,12 @@ ENV LIBRDKAFKA_VERSION 1.9.2 WORKDIR /app -RUN apt update && apt install -y wget make g++ libssl-dev autoconf automake libtool curl -RUN wget https://github.com/edenhill/librdkafka/archive/v${LIBRDKAFKA_VERSION}.tar.gz && \ - tar xvzf v${LIBRDKAFKA_VERSION}.tar.gz && \ - (cd librdkafka-${LIBRDKAFKA_VERSION}/ && ./configure && make && make install && ldconfig) +RUN apt update && \ + apt install -y wget make g++ libssl-dev autoconf automake libtool curl librdkafka-dev && \ + apt-get clean COPY . /app -RUN make install +RUN export POETRY_VIRTUALENVS_CREATE=false && make install/prod && pip cache purge -ENTRYPOINT make run \ No newline at end of file +ENTRYPOINT ocean sail \ No newline at end of file