MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.31k stars 21.49k forks source link

[Update docs] CosmosDB emulator container not work on Apple Silicon #106304

Closed galvesribeiro closed 1 year ago

galvesribeiro commented 1 year ago

The docs should mention this emulator don't work with MacOS on Apple Silicon (i.e. M1/M2) Macs.

When trying to run the container on Apple Silicon devices with the suggested commands:

docker run \
    --platform linux/amd64 \
    --publish 8081:8081 \
    --memory 3g --cpus=2.0 \
    --name=test-linux-emulator \
    --env AZURE_COSMOS_EMULATOR_PARTITION_COUNT=10 \
    --env AZURE_COSMOS_EMULATOR_ENABLE_DATA_PERSISTENCE=true \
    --env AZURE_COSMOS_EMULATOR_IP_ADDRESS_OVERRIDE=$ipaddr \
    --interactive \
    --tty \
    mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator

The container start but quickly it dies with the following message:

This is an evaluation version.  There are [67] days left in the evaluation period.

It works on Intel Macs but not on Apple Silicon.


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

RamanathanChinnappan-MSFT commented 1 year ago

@galvesribeiro Thanks for your feedback! We will investigate and update as appropriate.

shaktisingh-msft commented 1 year ago

Hi @StefArroyo,

Could you please look into this document request. Thanks

seesharprun commented 1 year ago

Hello @galvesribeiro!

The current version of the Docker emulator doesn't always work on M1 and M2 chips. We have added a note to the relevant article that will publish soon. The emulator team is hard at work looking for a workaround.

galvesribeiro commented 1 year ago

@seesharprun I think this emulator need a real revamp. It doesn't work on GitHub Actions and Azure DevOps pipelines either :(

seesharprun commented 1 year ago

:tada:

We recently released a complete revamp of the emulator documentation to cover many of the content gaps, be more succinct, and enable you to use the emulator quickly.

The new emulator documentation shows how to use the containerized (Docker) or local (Windows) variants of the emulators across five different APIs (NoSQL, MongoDB, Apache Cassandra, Apache Gremlin, Table) and three programming languages (Python, .NET, JavaScript).

We have also retired the outdated legacy emulator documentation as many of the code samples and instructions were out of date relative to the latest SDKs/libraries for each API and programming language.

Here's a few helpful links to get you started with the new emulator docs:

Link
Emulator landing page https://learn.microsoft.com/azure/cosmos-db/emulator
How-to use the emulator guide https://learn.microsoft.com/azure/cosmos-db/how-to-develop-emulator
Emulator release notes (local Windows only) https://learn.microsoft.com/azure/cosmos-db/emulator-release-notes
**Emulator command-line arguments (local Windows only) https://learn.microsoft.com/azure/cosmos-db/emulator-windows-arguments

I hope this helps unblock you. If you need changes to the emulator docs, feel free to open a new GitHub issue.

Thank you for your patience!

seesharprun commented 1 year ago

@seesharprun I think this emulator need a real revamp. It doesn't work on GitHub Actions and Azure DevOps pipelines either :(

Try this:

    name: Continuous Integration
    on:
      push:
        branches:
          - main
    jobs:
      unit_tests:
        name: Run Python unit tests
        runs-on: windows-latest
        steps:
          - name: Checkout (GitHub)
            uses: actions/checkout@v3
          - name: Start Azure Cosmos DB emulator
            run: >-
              Write-Host "Launching Cosmos DB Emulator"
              Import-Module "$env:ProgramFiles\Azure Cosmos DB Emulator\PSModules\Microsoft.Azure.CosmosDB.Emulator"
              Start-CosmosDbEmulator
          - name: Install test runner
            run: pip install pytest
          - name: Run Python tests
            run: pytest