GithubHelp home page GithubHelp logo

Comments (7)

underyx avatar underyx commented on July 30, 2024

we waste 139MB in the line COPY --from=semgrep /usr/local/bin/semgrep-core /tmp/semgrep-core which we can't delete later because docker layers are append-only. Either squash the image, or maybe we just can just install semgrep from pip?

But we need semgrep-core for semgrep to work at runtime. I don't think we lose any additional space during installation. We cannot directly install from pip cause the pip wheels don't (cannot) support Alpine linux.

from semgrep-action.

underyx avatar underyx commented on July 30, 2024

probably we don't need to use virtualenvs in the docker image, can just install as system deps?

We had dependency version conflicts between bento & semgrep a while ago, which is why we started doing this. I kinda like that semgrep-agent and semgrep have independent dependencies, one less thing to worry about when developing.

from semgrep-action.

ievans avatar ievans commented on July 30, 2024

I chatted with @underyx and clarified some things:

I was trying to say that that second install copies the 139MB into /root/.local/pipx if i understand correctly, so we donโ€™t need the /tmp anymore. but the rm -rf /tmp is not reclaiming any space. b/c the docker layers are append only the rm -rf /tmp is useless. If you build with --squash youโ€™ll reclaim it, but thatโ€™s an experimental flag

from semgrep-action.

mschwager avatar mschwager commented on July 30, 2024

Removing PRECOMPILED_LOCATION (https://github.com/returntocorp/semgrep-action/pull/156) took this down to 313MB for me. Removing reliance on pipx brought it down to 291MB. Should we remove pipx and call this done?

from semgrep-action.

ievans avatar ievans commented on July 30, 2024

๐Ÿ‘ from me @mschwager!

from semgrep-action.

raghavjain3 avatar raghavjain3 commented on July 30, 2024

Closing since the image here seems to be significantly smaller in size than a few months ago (60MB compressed instead of 100+MB).

@ievans please feel free to reopen if you find this to still be an issue

from semgrep-action.

ievans avatar ievans commented on July 30, 2024

brilliant work all!

from semgrep-action.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.