cog icon indicating copy to clipboard operation
cog copied to clipboard

Cog Push Error: This image doesn't look like it was built with Cog.

Open kiradeva opened this issue 1 year ago • 1 comments

When using cog to push to repilcate we are getting the following error: This image doesn't look like it was built with Cog. You can only push images built with Cog to Replicate: https://github.com/replicate/cog

Here is the github actions that we are using:

name: cog-build-deploy

on:
  workflow_call:
    inputs:
      folder:
        required: true
        type: string
        description: "Path to the model folder"
      model_name:
        required: true
        type: string
        description: "Name of the model to deploy"
      gpu:
        required: false
        type: boolean
        description: "Set to true if your model requires a GPU"
        default: false

    secrets:
        REPLICATE_TOKEN:
          required: true


jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Free Disk Space (Ubuntu)
        uses: jlumbroso/free-disk-space@main
        with:
          tool-cache: false
          android: true
          dotnet: true
          haskell: true
          large-packages: true
          docker-images: true
          swap-storage: true

      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v3

      - name: Check out code
        uses: actions/checkout@v4

      - name: Setup Cog
        uses: replicate/[email protected]
        with:
          token: ${{ secrets.REPLICATE_TOKEN }}
          install-cuda: ${{ inputs.gpu }}
          cog-version: v0.9.7


      - name: Download weights
        working-directory: ${{ inputs.folder }}
        run: |
          echo ${{ secrets.REPLICATE_TOKEN }} | cog login --token-stdin
          chmod +x script/download_weights
          cog run script/download_weights

      - name: Push to Replicate
        working-directory: ${{ inputs.folder }}
        env:
          REPLICATE_API_TOKEN: ${{ secrets.REPLICATE_TOKEN }}
        run: |
          echo ${{ secrets.REPLICATE_TOKEN }} | cog login --token-stdin
          cog push r8.im/my-org/${{ inputs.model_name }}

kiradeva avatar May 10 '24 15:05 kiradeva

Hey @kiradeva. That error comes from Replicate's registry proxy and it appears to occur when something is wrong with the Cog version number or the cog.yaml config.

Please try the following changes and let us know if it fixes your workflow:

  • Use replicate/setup-cog@v2
  • Remove the buildx step from your workflow, as it's covered by setup-cog
  • Make sure the working-directory: ${{ inputs.folder }} is referring to the correct location

zeke avatar Jun 06 '24 14:06 zeke