saltstack-formulas / docker-formula

Install and set up Docker
http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
136 stars 330 forks source link

[JFROG] bintray is gone away - docker-compose state failed #281

Closed noelmcloughlin closed 3 years ago

noelmcloughlin commented 3 years ago

Describe the bug

Jfrog has shutdown bintray: https://www.infoq.com/news/2021/02/jfrog-jcenter-bintray-closure/

          ID: docker-compose-software-binary-install
    Function: file.managed
        Name: /usr/local/docker-compose-latest/bin//docker-compose
      Result: False
     Comment: Attempt 1: Returned a result of "False", with the following comment: "Failed to cache https://dl.bintray
.com/docker-compose/master/docker-compose-Linux-x86_64: Error: HTTP 403: Forbidden reading https://dl.bintray.com/dock
er-compose/master/docker-compose-Linux-x86_64"
              Attempt 2: Returned a result of "False", with the following comment: "Failed to cache https://dl.bintray
.com/docker-compose/master/docker-compose-Linux-x86_64: Error: HTTP 403: Forbidden reading https://dl.bintray.com/dock
er-compose/master/docker-compose-Linux-x86_64"
              Failed to cache https://dl.bintray.com/docker-compose/master/docker-compose-Linux-x86_64: Error: HTTP 40
3: Forbidden reading https://dl.bintray.com/docker-compose/master/docker-compose-Linux-x86_64
     Started: 19:44:00.721217
    Duration: 135371.269 ms
     Changes:
----------
          ID: docker-compose-software-binary-install-symlink-docker-compose
    Function: file.symlink
        Name: /usr/local/bin/docker-compose
      Result: False
     Comment: One or more requisite failed: docker.compose.software.binary.install.docker-compose-software-binary-inst
all
     Started: 19:46:16.174253
    Duration: 0.005 ms
     Changes:
B1ue-W01f commented 3 years ago

For those coming across this issue, a temporary solution is to override the pillar defaults as below:

docker:
  pkg:
    compose:
      binary:
        options: ''
        source: 'https://github.com/docker/compose/releases/download/1.29.1/docker-compose-Linux-x86_64'
        source_hash: '8097769d32e34314125847333593c8edb0dfc4a5b350e4839bef8c2fe8d09de7'

Using the releases from the Docker Compose Github

danny-smit commented 3 years ago

Can we use the github.com sources by default in the formula yaml files as well? That seems to work if I test it.

However, with the current use of bintray.org the source always points 'latest', but the source_hash is hard-coded. I'm a bit confused by that. Isn't the hash of the 'latest' changing all the time?

noelmcloughlin commented 3 years ago

Looking at https://github.com/docker/compose/releases each release tarball (tar.gz) has a checksum (tar.gz.sha256).

If source_hash: null then formula will automatically calculate correct source_hash value so nullis best for github source. https://github.com/saltstack-formulas/docker-formula/blob/4cc1e706e4778e1aabef0023da668eaafef8afff/docker/map.jinja#L55-L59

danny-smit commented 3 years ago

@noelmcloughlin Thanks, that seems to work: #290

myii commented 3 years ago

Fixed by #290.