Skip to content

Commit 273a2c1

Browse files
author
Chris Cho
authored
DOCSP-25538: Add platform to Docker commands (#31)
* DOCSP-25538: Add platform to Docker commands
1 parent 8afa0ff commit 273a2c1

File tree

6 files changed

+135
-32
lines changed

6 files changed

+135
-32
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.. note::
2+
3+
If you are running an Apple M1 CPU, you need to specify the
4+
``--platform='linux/arm64'`` option when running the command to create
5+
the tutorial Docker container. Select the :guilabel:`Apple M1 Processors`
6+
tab to see the full command.
7+

source/tutorials/explore-change-streams.txt

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,42 @@ Explore Change Streams
2727

2828
.. step:: Connect to the Docker Container
2929

30+
.. include:: /includes/tutorials/robwma-m1-arch.txt
31+
3032
Create two interactive shell sessions on the tutorial Docker
3133
Container, each in a separate window.
3234

33-
.. code-block:: bash
34-
:copyable: true
35-
:caption: This command starts an interactive shell called ChangeStreamShell1
35+
.. tabs::
3636

37-
docker run --rm --name ChangeStreamShell1 --network mongodb-kafka-base_localnet -it robwma/mongokafkatutorial:latest bash
37+
.. tab:: Intel Processors
38+
:tabid: intel-cpu
3839

39-
.. code-block:: bash
40-
:copyable: true
41-
:caption: This command starts an interactive shell called ChangeStreamShell2
40+
.. code-block:: bash
41+
:caption: This command starts an interactive shell called ChangeStreamShell1
42+
43+
docker run --rm --name ChangeStreamShell1 --network mongodb-kafka-base_localnet -it robwma/mongokafkatutorial:latest bash
44+
45+
.. code-block:: bash
46+
:caption: This command starts an interactive shell called ChangeStreamShell2
47+
48+
docker run --rm --name ChangeStreamShell2 --network mongodb-kafka-base_localnet -it robwma/mongokafkatutorial:latest bash
49+
50+
.. tab:: Apple M1 Processors
51+
:tabid: apple-m1-cpu
52+
53+
.. code-block:: bash
54+
:caption: This command starts an interactive shell called ChangeStreamShell1
55+
56+
docker run --platform='linux/arm64' --rm --name ChangeStreamShell1 --network mongodb-kafka-base_localnet -it robwma/mongokafkatutorial:latest bash
57+
58+
.. code-block:: bash
59+
:caption: This command starts an interactive shell called ChangeStreamShell2
4260

43-
docker run --rm --name ChangeStreamShell2 --network mongodb-kafka-base_localnet -it robwma/mongokafkatutorial:latest bash
61+
docker run --platform='linux/arm64' --rm --name ChangeStreamShell2 --network mongodb-kafka-base_localnet -it robwma/mongokafkatutorial:latest bash
4462

4563
.. step:: Open a Change Stream
4664

47-
In **ChangeStreamShell1**, create a Python script to open a change
65+
In **ChangeStreamShell1**, create a Python script to open a change
4866
stream using the PyMongo driver.
4967

5068
.. code-block:: bash

source/tutorials/migrate-time-series.txt

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,6 @@ from a collection to a time series collection. The time series collection
3232
stores and indexes the data more efficiently and retains the ability to analyze
3333
stock performance over time using aggregation operators.
3434

35-
.. important:: Apple M1 incompatibility
36-
37-
This tutorial requires the time series collection feature introduced in
38-
MongoDB version 5.0. The MongoDB Docker image does not currently build for
39-
any version after 4.x on an M1 CPU, and therefore cannot run the complete
40-
tutorial. MongoDB developers are currently working on resolving this
41-
issue.
42-
4335
Migrate a Collection to a Time Series Collection
4436
------------------------------------------------
4537

@@ -52,13 +44,27 @@ Migrate a Collection to a Time Series Collection
5244

5345
.. step:: Generate Sample Data
5446

47+
.. include:: /includes/tutorials/robwma-m1-arch.txt
48+
5549
Run the following command to start a Docker container that generates
5650
a sample collection containing fabricated stock symbols and their prices
5751
in your tutorial MongoDB replica set:
5852

59-
.. code-block:: bash
53+
.. tabs::
54+
55+
.. tab:: Intel Processors
56+
:tabid: intel-cpu
57+
58+
.. code-block:: bash
59+
60+
docker run --rm --network mongodb-kafka-base_localnet -it robwma/stockgenmongo:1.0 -c "mongodb://mongo1" -db Stocks -col PriceData
61+
62+
.. tab:: Apple M1 Processors
63+
:tabid: apple-m1-cpu
64+
65+
.. code-block:: bash
6066

61-
docker run --rm --network mongodb-kafka-base_localnet -it robwma/stockgenmongo:1.0 -c "mongodb://mongo1" -db Stocks -col PriceData
67+
docker run --platform='linux/arm64' --rm --network mongodb-kafka-base_localnet -it robwma/stockgenmongo:1.0 -c "mongodb://mongo1" -db Stocks -col PriceData
6268

6369
Once the data generator starts running, you should see the generated
6470
data that resembles the following:
@@ -77,9 +83,23 @@ Migrate a Collection to a Time Series Collection
7783
Create an interactive shell session on the tutorial Docker container
7884
downloaded for the Tutorial Setup using the following command:
7985

80-
.. code-block:: bash
8186

82-
docker run --rm --name TimeSeriesTutorial --network mongodb-kafka-base_localnet -it robwma/mongokafkatutorial:latest bash
87+
.. tabs::
88+
89+
.. tab:: Intel Processors
90+
:tabid: intel-cpu
91+
92+
.. code-block:: bash
93+
94+
docker run --rm --name TimeSeriesTutorial --network mongodb-kafka-base_localnet -it robwma/mongokafkatutorial:latest bash
95+
96+
97+
.. tab:: Apple M1 Processors
98+
:tabid: apple-m1-cpu
99+
100+
.. code-block:: bash
101+
102+
docker run --platform='linux/arm64' --rm --name TimeSeriesTutorial --network mongodb-kafka-base_localnet -it robwma/mongokafkatutorial:latest bash
83103

84104
Create a source configuration file called ``stock-source.json`` with the
85105
following command:

source/tutorials/replicate-with-cdc.txt

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,49 @@ Replicate Data with a CDC Handler
4646
windows. In the tutorial, you can use the shells to run and observe
4747
different tasks.
4848

49+
.. include:: /includes/tutorials/robwma-m1-arch.txt
50+
4951
Run the following command in the terminal to start an interactive shell
5052
called **CDCShell1** in one terminal window:
5153

52-
.. code-block:: bash
53-
:caption: This command starts an interactive shell called CDCShell1
54+
.. tabs::
55+
56+
.. tab:: Intel Processors
57+
:tabid: intel-cpu
58+
59+
.. code-block:: bash
60+
:caption: This command starts an interactive shell called CDCShell1
61+
62+
docker run --rm --name CDCShell1 --network mongodb-kafka-base_localnet -it robwma/mongokafkatutorial:latest bash
63+
64+
.. tab:: Apple M1 Processors
65+
:tabid: apple-m1-cpu
66+
67+
.. code-block:: bash
68+
:caption: This command starts an interactive shell called CDCShell1
5469

55-
docker run --rm --name CDCShell1 --network mongodb-kafka-base_localnet -it robwma/mongokafkatutorial:latest bash
70+
docker run --platform='linux/arm64' --rm --name CDCShell1 --network mongodb-kafka-base_localnet -it robwma/mongokafkatutorial:latest bash
5671

5772
Run the following command in the terminal to start an interactive shell
5873
called **CDCShell2** in the other terminal window:
5974

60-
.. code-block:: bash
61-
:caption: This command starts an interactive shell called CDCShell2
75+
.. tabs::
76+
77+
.. tab:: Intel Processors
78+
:tabid: intel-cpu
79+
80+
.. code-block:: bash
81+
:caption: This command starts an interactive shell called CDCShell2
82+
83+
docker run --rm --name CDCShell2 --network mongodb-kafka-base_localnet -it robwma/mongokafkatutorial:latest bash
84+
85+
.. tab:: Apple M1 Processors
86+
:tabid: apple-m1-cpu
87+
88+
.. code-block:: bash
89+
:caption: This command starts an interactive shell called CDCShell2
6290

63-
docker run --rm --name CDCShell2 --network mongodb-kafka-base_localnet -it robwma/mongokafkatutorial:latest bash
91+
docker run --platform='linux/arm64' --rm --name CDCShell2 --network mongodb-kafka-base_localnet -it robwma/mongokafkatutorial:latest bash
6492

6593
Arrange the two windows on your screen to keep both of them visible to
6694
see real-time updates.

source/tutorials/sink-connector.txt

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,28 @@ Get Started with the MongoDB Kafka Sink Connector
2626

2727
.. step:: Configure the Sink Connector
2828

29+
.. include:: /includes/tutorials/robwma-m1-arch.txt
30+
2931
Create an interactive shell session on the tutorial Docker Container
3032
using the following command:
3133

32-
.. code-block:: bash
33-
:copyable: true
34+
.. tabs::
35+
36+
.. tab:: Intel Processors
37+
:tabid: intel-cpu
38+
39+
.. code-block:: bash
40+
:copyable: true
41+
42+
docker run --rm --name SinkTutorialShell --network mongodb-kafka-base_localnet -it robwma/mongokafkatutorial:latest bash
43+
44+
.. tab:: Apple M1 Processors
45+
:tabid: apple-m1-cpu
46+
47+
.. code-block:: bash
48+
:copyable: true
3449

35-
docker run --rm --name SinkTutorialShell --network mongodb-kafka-base_localnet -it robwma/mongokafkatutorial:latest bash
50+
docker run --rm --platform='linux/arm64' --name SinkTutorialShell --network mongodb-kafka-base_localnet -it robwma/mongokafkatutorial:latest bash
3651

3752
Create a source configuration file called ``simplesink.json`` with
3853
the following command:

source/tutorials/source-connector.txt

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,27 @@ Get Started with the MongoDB Kafka Source Connector
2525

2626
.. step:: Configure the Source Connector
2727

28+
.. include:: /includes/tutorials/robwma-m1-arch.txt
29+
2830
Create an interactive shell session on the tutorial Docker container
2931
downloaded for the Tutorial Setup using the following command:
3032

31-
.. code-block:: bash
33+
.. tabs::
34+
35+
.. tab:: Intel Processors
36+
:tabid: intel-cpu
37+
38+
.. code-block:: bash
39+
40+
docker run --rm --name SourceTutorialShell --network mongodb-kafka-base_localnet -it robwma/mongokafkatutorial:latest bash
41+
42+
.. tab:: Apple M1 Processors
43+
:tabid: apple-m1-cpu
44+
45+
.. code-block:: bash
46+
47+
docker run --platform='linux/arm64' --rm --name SourceTutorialShell --network mongodb-kafka-base_localnet -it robwma/mongokafkatutorial:latest bash
3248

33-
docker run --rm --name SourceTutorialShell --network mongodb-kafka-base_localnet -it robwma/mongokafkatutorial:latest bash
3449

3550
Create a source configuration file called ``simplesource.json`` with
3651
the following command:

0 commit comments

Comments
 (0)