This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 使用稳定python瘦身版,减少镜像体积 | |
FROM python:3.9.15-slim-buster | |
# 禁用pip缓存,减少镜像体积 | |
ENV PIP_NO_CACHE_DIR=1 | |
RUN sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list && \ | |
apt update && \ | |
apt-get install -y --no-install-recommends gcc ffmpeg libsm6 libxext6 g++ && \ | |
rm -rf /var/lib/apt/lists/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1 | |
kind: StatefulSet | |
metadata: | |
name: {{ template "fullname" . }}-master | |
labels: | |
app: {{ template "fullname" . }}-master | |
chart: "{{ template "mysqlha.chart" . }}" | |
release: "{{ .Release.Name }}" | |
heritage: "{{ .Release.Service }}" | |
spec: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def inet_ntoa(n): | |
import socket, struct | |
if n: | |
try: | |
packed_value = struct.pack('!I', int(n)) | |
ip = socket.inet_ntoa(packed_value) | |
return ip | |
except: | |
return None | |
return None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from multiprocessing import Pool as MPool | |
from time import sleep | |
import datetime | |
import multiprocessing | |
import random | |
def time_request(): | |
from gevent import monkey; monkey.patch_socket | |
from jsonrequester import JsonRequester |