-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
M1 mac compatibility #5511
M1 mac compatibility #5511
Changes from all commits
fd10ea3
9dde236
2827fdc
0d6598e
30bf2c5
cef3d29
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -186,7 +186,9 @@ kafka_connect_string: "{% set ret = [] %}\ | |
kafka_protocol_for_setup: "{{ kafka_protocol | default('PLAINTEXT') }}" | ||
|
||
zookeeper: | ||
version: 3.4 | ||
image: | ||
amd64: zookeeper:3.4 | ||
arm64: arm64v8/zookeeper:3.4 | ||
port: 2181 | ||
|
||
zookeeper_connect_string: "{% set ret = [] %}\ | ||
|
@@ -464,7 +466,7 @@ zeroDowntimeDeployment: | |
enabled: "{{ zerodowntime_deployment_switch | default(false) }}" | ||
|
||
etcd: | ||
version: "{{ etcd_version | default('v3.4.33') }}" | ||
version: "{{ etcd_version | default('3.5') }}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. etcd supports multiarch since 3.5 version. ![]() There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know this is stale now, but does etcd still require one to enable experimental features to run on arm? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ignore that, I found the answer. Looks like arm64 has first-class support now as of 3.5. Previously it required one to use the ETCD_UNSUPPORTED_ARCH environment variable. |
||
client: | ||
port: 2379 | ||
server: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,24 +38,13 @@ | |
- name: (re)start etcd | ||
docker_container: | ||
name: etcd{{ groups['etcd'].index(inventory_hostname) }} | ||
image: quay.io/coreos/etcd:{{ etcd.version }} | ||
image: bitnami/etcd:{{ etcd.version }} | ||
state: started | ||
recreate: true | ||
restart_policy: "{{ docker.restart.policy }}" | ||
volumes: "{{volume_dir | default([])}}" | ||
command: "/usr/local/bin/etcd \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Before merging, I will check how to enable these options with the Bitnami/etcd image. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this can be addressed in a subsequent PR. |
||
--data-dir=/etcd-data --name '{{ name }}' \ | ||
--initial-advertise-peer-urls http://{{ ansible_host }}:{{ etcd.server.port + groups['etcd'].index(inventory_hostname) }} \ | ||
--advertise-client-urls http://{{ ansible_host }}:{{ etcd.client.port + groups['etcd'].index(inventory_hostname) }} \ | ||
--listen-peer-urls http://0.0.0.0:{{ etcd.server.port + groups['etcd'].index(inventory_hostname) }} \ | ||
--listen-client-urls http://0.0.0.0:{{ etcd.client.port + groups['etcd'].index(inventory_hostname) }} \ | ||
--initial-cluster {{ cluster }} \ | ||
--initial-cluster-state new --initial-cluster-token {{ etcd.cluster.token }} \ | ||
--quota-backend-bytes {{ etcd.quota_backend_bytes }} \ | ||
--snapshot-count {{ etcd.snapshot_count }} \ | ||
--auto-compaction-retention {{ etcd.auto_compaction_retention }} \ | ||
--auto-compaction-mode {{ etcd.auto_compaction_mode }} \ | ||
--log-level {{ etcd.loglevel }}" | ||
env: | ||
"ALLOW_NONE_AUTHENTICATION": "yes" | ||
ports: | ||
- "{{ etcd.client.port + groups['etcd'].index(inventory_hostname) }}:{{ etcd.client.port + groups['etcd'].index(inventory_hostname) }}" | ||
- "{{ etcd.server.port + groups['etcd'].index(inventory_hostname) }}:{{ etcd.server.port + groups['etcd'].index(inventory_hostname) }}" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,7 +80,7 @@ | |
when: environmentInformation.type == "docker-machine" | ||
|
||
- name: "determine docker root dir" | ||
shell: echo -e "GET http:/v1.24/info HTTP/1.0\r\n" | nc -U /var/run/docker.sock | grep "{" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It doesn't work with the recent version of docker for mac. |
||
shell: docker info -f json | ||
args: | ||
executable: /bin/bash | ||
register: dockerInfo_output | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,10 +17,20 @@ | |
--- | ||
# This role will install Kafka with Zookeeper in group 'kafka' in the environment inventory | ||
|
||
- name: set zookeeper image | ||
set_fact: | ||
zookeeper_image: "{{ zookeeper.image.arm64 }}" | ||
when: ansible_facts['os_family'] == "Darwin" and ansible_facts['architecture'] == "arm64" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Selectively use the arm64 zookeeper image according to the os and architecture. |
||
|
||
- name: set zookeeper image | ||
set_fact: | ||
zookeeper_image: "{{ zookeeper.image.amd64 }}" | ||
when: ansible_facts['os_family'] != "Darwin" or ansible_facts['architecture'] != "arm64" | ||
|
||
- name: (re)start zookeeper | ||
docker_container: | ||
name: zookeeper{{ groups['zookeepers'].index(inventory_hostname) }} | ||
image: zookeeper:{{ zookeeper.version }} | ||
image: "{{ zookeeper_image }}" | ||
state: started | ||
recreate: true | ||
restart_policy: "{{ docker.restart.policy }}" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
# if you change version of openjsk, also update tools/github/setup.sh to download the corresponding jdk | ||
FROM arm64v8/eclipse-temurin:21.0.4_7-jdk-alpine | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only the base image is changed. |
||
|
||
ENV LANG en_US.UTF-8 | ||
ENV LANGUAGE en_US:en | ||
ENV LC_ALL en_US.UTF-8 | ||
|
||
# Switch to the HTTPS endpoint for the apk repositories as per https://github.com/gliderlabs/docker-alpine/issues/184 | ||
RUN sed -i 's/http\:\/\/dl-cdn.alpinelinux.org/https\:\/\/alpine.global.ssl.fastly.net/g' /etc/apk/repositories | ||
RUN apk add --update sed curl bash && apk update && apk upgrade | ||
|
||
RUN mkdir /logs | ||
|
||
COPY transformEnvironment.sh / | ||
RUN chmod +x transformEnvironment.sh | ||
|
||
COPY copyJMXFiles.sh / | ||
RUN chmod +x copyJMXFiles.sh |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,9 @@ plugins { | |
} | ||
|
||
ext.dockerImageName = 'scala' | ||
if(System.getProperty("os.arch").toLowerCase(Locale.ENGLISH).startsWith("aarch")) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the architecture of OS is m1 Mac, it uses the Dockerfile with the |
||
ext.dockerDockerfileSuffix = ".arm" | ||
} | ||
apply from: '../../gradle/docker.gradle' | ||
|
||
project.archivesBaseName = "openwhisk-common" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,6 +52,16 @@ buildscript { | |
} | ||
} | ||
|
||
protobuf { | ||
protoc { | ||
if (osdetector.os == "osx") { | ||
artifact = 'com.google.protobuf:protoc:3.4.0:osx-x86_64' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IIRC, we cant' upgrade the protoc version for now because some libraries are dependent on this version. |
||
} else { | ||
artifact = 'com.google.protobuf:protoc:3.4.0' | ||
} | ||
} | ||
} | ||
|
||
// Define a separate configuration for managing the dependency on Jetty ALPN agent. | ||
configurations { | ||
alpnagent | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
FROM arm64v8/eclipse-temurin:8u422-b05-jdk-noble | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
ENV DOCKER_VERSION 1.12.0 | ||
ENV KUBECTL_VERSION v1.16.3 | ||
ENV WHISK_CLI_VERSION latest | ||
ENV WHISKDEPLOY_CLI_VERSION latest | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
git \ | ||
jq \ | ||
libffi-dev \ | ||
nodejs \ | ||
npm \ | ||
python-is-python3 \ | ||
python3-pip \ | ||
python3-venv \ | ||
wget \ | ||
zip \ | ||
locales \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# update npm | ||
RUN npm install -g n && n stable && hash -r | ||
|
||
RUN locale-gen en_US.UTF-8 | ||
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' | ||
|
||
WORKDIR /root | ||
|
||
RUN python -m venv .venv | ||
ENV PATH="/root/.venv/bin:$PATH" | ||
|
||
# Python packages | ||
RUN pip3 install --upgrade pip | ||
RUN pip3 install --upgrade setuptools | ||
RUN pip3 install cryptography && \ | ||
pip3 install ansible==2.5.2 && \ | ||
pip3 install jinja2==2.9.6 && \ | ||
pip3 install docker | ||
|
||
# Install docker client | ||
RUN wget --no-verbose https://get.docker.com/builds/Linux/x86_64/docker-${DOCKER_VERSION}.tgz && \ | ||
tar --strip-components 1 -xvzf docker-${DOCKER_VERSION}.tgz -C /usr/bin docker/docker && \ | ||
rm -f docker-${DOCKER_VERSION}.tgz && \ | ||
chmod +x /usr/bin/docker | ||
|
||
# Install kubectl in /usr/local/bin | ||
RUN curl -Lo ./kubectl https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl && chmod +x kubectl && mv kubectl /usr/local/bin/kubectl | ||
|
||
# Install `wsk` cli in /usr/local/bin | ||
RUN wget -q https://github.com/apache/openwhisk-cli/releases/download/$WHISK_CLI_VERSION/OpenWhisk_CLI-$WHISK_CLI_VERSION-linux-amd64.tgz && \ | ||
tar xzf OpenWhisk_CLI-$WHISK_CLI_VERSION-linux-amd64.tgz -C /usr/local/bin wsk && \ | ||
rm OpenWhisk_CLI-$WHISK_CLI_VERSION-linux-amd64.tgz | ||
|
||
# Install wskadmin in /bin | ||
COPY wskutil.py /bin | ||
COPY wskprop.py /bin | ||
COPY wskadmin /bin | ||
|
||
# Setup tools/data for certificate generation (used by openwhisk-deploy-kube) | ||
RUN mkdir /cert-gen | ||
COPY openwhisk-server-key.pem /cert-gen | ||
COPY genssl.sh /usr/local/bin/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added another zookeeper image for arm64