composer / satis

Simple static Composer repository generator - For a full private Composer repo use Private Packagist

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Question] Speed Satis vs Git

Avalarion opened this issue · comments

Hey there,

I am currently willing to speed up our composer based deployments. In order to do this one approach was to install satis in our infrastructure as we are using plain git packages right now.

I was not able to find a hint anywhere telling me if satis is able to speed up our deployment or not. Will it only resolve the Versions for me or will it also "cache" the composer process so that we don't have to wait for Git?

Have a nice day,

Bastian

Satis may create local ZIP copies of any released version of the libraries you use. By having the copies local, download speed may increase during your installs. The most important part is that Satis will also host any private repositories and create ZIPs for them as well.

On the other hand, Composer really tries to optimize any remote network access, caching almost everything, or having local clones of repositories.

Using Satis may not speed up your experience significantly, but this depends on your current workflow and the reasons you perceive it as being slow.

I can only state for myself that the most important reason to use Satis is having private repositories being used everywhere, and with the appropriate setup also all remote libraries have their local copy. Turning off packagist.org and only working with a very reduced subset of everything further limits the search space that Composer has to work with when updating, and I cannot complain about things being awfully slow.

YMMV, however.

Hey Sven,

thank you so much for your answer. Having local Zip copies could speed up everything a lot!

So I will put this on our agenda =). If you have an example how to work as proxy I am interested in this. All I was able to find is a resource from 2014 and I am not sure if this is not yet outdated^^.

As you answered my question I am going to close this ticket now.

Have a nice day,

Bastian

I implemented a two step process:

  • First fetch all external repos and their dependencies, but without creating ZIPs. The metadata goes into a local temporary (not really, but it isn't used beyond the next step) composer repository.
  • Then fetch all local repositories (git, svn), including the one created in step one (composer does not care that this is a "composer" repo - it has metadata just like a regular git repo with a composer.json), and create ZIP files.

As a config illustration (note that current Satis versions may have changed, this is running with an older version):

Step 1:

{
    "name": "Temp Satis Repo",
    "repositories": [
        {
            "type":"composer",
            "url":"https://packagist.org"
        }
    ],
    "require": {
        "acclimate/container": ">=1.0"
    }
    "output-html": false,
    "require-dependencies": true,
    "homepage": "https://somewhere.example/temprepo"
}

Step 2:
Note that the homepage URL from above get's reused here.

{
    "name": "Internal Satis Repo",
    "repositories": [
        {
            "type": "composer",
            "url": "https://somewhere.example/temprepo"
        },
        {
           "type": "vcs",
           "ssh://git@reposerver/project.git"
        }
    ],
    "require-all": true,
    "archive": {
        "directory": "dist",
        "format": "zip",
        "prefix-url": "https://somewhere.example/internal-satis",
        "skip-dev": true
    }
    "homepage": "https://somewhere.example/internal-satis"
}