Someone asked in chat (paraphrased) "I am coming from synchronous online systems, and now am going to work on a queue-based system. What should I be aware of?" This is a (somewhat freely-associated) collection of thoughts, based on my experience at SoundCloud.
# I needed to delete ~300k objects from an S3 bucket in a hurry. The better and cheaper solution is to use a lifecycle rule, but those can take a day or two to take effect. | |
bucket="i-want-to-lose-all-my-data" | |
mkdir -p deletes | |
# 1. List all the objects in the bucket, transform them 1000 at a time into request objects for DeleteObjects, write each to a separate file | |
aws s3api list-objects-v2 --bucket "${bucket}" \ | |
| jq -c '.Contents | _nwise(1000) | map({ Key: .Key }) | { Objects: ., Quiet: true }' \ | |
| awk '{ f = "deletes/" NR ".json"; print $0 > f; close(f) }' |
$ kubectl --namespace mr-test exec -ti hostname-test bash | |
root@hostname-test:/# cat /etc/hosts | |
# Kubernetes-managed hosts file. | |
127.0.0.1 localhost | |
::1 localhost ip6-localhost ip6-loopback | |
fe00::0 ip6-localnet | |
fe00::0 ip6-mcastprefix | |
fe00::1 ip6-allnodes | |
fe00::2 ip6-allrouters | |
10.128.1.142 hostname-test |
The MIT License (MIT)
Copyright © 2017 SoundCloud Ltd.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
% for v in 1.3.5 1.3.6 1.3.7 1.3.8 1.4.0 1.4.1; do echo ========= $v ==========; curl -sSfL "https://github.com/kubernetes/kubernetes/releases/download/v${v}/kubernetes.tar.gz" | tar -O -zxf - kubernetes/server/kubernetes-server-linux-amd64.tar.gz | tar -tvzf -; done | |
========= 1.3.5 ========== | |
drwxr-xr-x 0 root root 0 Aug 11 20:35 kubernetes/ | |
-rw-r--r-- 0 root root 3533536 Aug 11 20:35 kubernetes/LICENSES | |
-rw-r--r-- 0 root root 41933134 Aug 11 20:35 kubernetes/kubernetes-src.tar.gz | |
drwxr-xr-x 0 root root 0 Aug 11 20:35 kubernetes/server/ | |
drwxr-xr-x 0 root root 0 Aug 11 20:35 kubernetes/server/bin/ | |
-rw-r--r-- 0 root root 33 Aug 11 20:35 kubernetes/server/bin/federation-apiserver.docker_tag | |
-rw-r--r-- 0 root root 33 Aug 11 20:35 kubernetes/server/bin/federation-controller-manager.docker_tag | |
-rw-r--r-- 0 root root 104576512 Aug 11 20:35 kubernetes/server/bin/federation-apiserver.tar |
#!/bin/sh | |
set -eufx | |
tmpdir=$(mktemp -d ./prometheus-1610.XXXX) | |
cd "${tmpdir}" | |
cleanup() { | |
set +e |
KUBERNETES_VERSION ?= v1.1.3 | |
KUBERNETES_SOURCE_URL = https://github.com/kubernetes/kubernetes/archive/v$(KUBERNETES_VERSION).tar.gz | |
LOCAL_SOURCES := $(shell find local -type f) | |
.PHONY: prepare | |
prepare: vendor/k8s.io/kubernetes/.available vendor/k8s.io/kubernetes/.lifted_godeps $(LOCAL_SOURCES:local/%=vendor/%) | |
# Lift a source tree into the vendor tree, skipping Godeps | |
vendor/%/.available: build/$(KUBERNETES_VERSION)/%/.available |
I hereby claim:
- I am matthiasr on github.
- I am matthiasr (https://keybase.io/matthiasr) on keybase.
- I have a public key whose fingerprint is F46A 5FAA 9508 311D DBCC 403A 9A7D 111C AE60 D44B
To claim this, I am signing this object:
translate["ESTAB"] = "ESTABLISHED"; | |
translate["SYN-SENT"] = "SYN_SENT"; | |
translate["SYN-RECV"] = "SYN_RECV"; | |
translate["FIN-WAIT-1"] = "FIN_WAIT1"; | |
translate["FIN-WAIT-2"] = "FIN_WAIT2"; | |
translate["TIME-WAIT"] = "TIME_WAIT"; | |
translate["UNCONN"] = "CLOSE"; | |
translate["CLOSE-WAIT"] = "CLOSE_WAIT"; | |
translate["LAST-ACK"] = "LAST_ACK"; | |
translate["LISTEN"] = "LISTEN"; |
#!/bin/sh | |
echo buildconf | |
./buildconf 2> /dev/null > /dev/null || exit 125 | |
echo configure | |
./configure 2> /dev/null > /dev/null || exit 125 | |
echo make | |
make 2> /dev/null > /dev/null || exit 125 | |
echo Attempting to use the curl we just built ... |