-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix!: force containerd to pull already saved tagged images
Images were pulled from remote registries and not from the already saved images from ipfs during pod creation. so i tried to tag the images with the CID and replace the image url with the tag. this also fixes the case where the client uploads from private registries, because they will be inaccessible such as the case with the autoscaler in the test that is stored in the local docker registry. The problem was that containerd will always prefix the tagged images with docker.io/ to resolve them remotely again, therefore bypassing the saved images from ipfs. and unless its a known registry, such as gcr or docker.io, it will always get prefixed, even localhost. So the solution was simple,just disable pulling images completely, therefore it will resort to the saved images with prefixing, it just takes it as it is.
- Loading branch information
Showing
10 changed files
with
124 additions
and
40 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
docker build -t comradecoop/apocryph/server:latest ../../.. --target server | ||
|
||
docker build -t comradecoop/apocryph/p2p-helper:latest ../../.. --target p2p-helper | ||
|
||
docker build -t comradecoop/apocryph/autoscaler:latest ../../.. --target autoscaler | ||
|
||
docker run -d -p 5000:5000 --restart=always --name registry registry:2 || echo "Docker registry already running" | ||
|
||
docker tag comradecoop/apocryph/server:latest localhost:5000/comradecoop/apocryph/server:latest | ||
docker push localhost:5000/comradecoop/apocryph/server:latest | ||
|
||
docker tag comradecoop/apocryph/p2p-helper:latest localhost:5000/comradecoop/apocryph/p2p-helper:latest | ||
docker push localhost:5000/comradecoop/apocryph/p2p-helper:latest | ||
|
||
docker tag comradecoop/apocryph/autoscaler:latest localhost:5000/comradecoop/apocryph/autoscaler:latest | ||
docker push localhost:5000/comradecoop/apocryph/autoscaler:latest | ||
|
||
minikube profile c1 | ||
kubectl delete namespace trustedpods | ||
helmfile apply -f ../minikube -l name=trustedpods --skip-deps | ||
|
||
minikube profile c2 | ||
kubectl delete namespace trustedpods | ||
helmfile apply -f ../minikube -l name=trustedpods --skip-deps | ||
|
||
minikube profile c3 | ||
kubectl delete namespace trustedpods | ||
helmfile apply -f ../minikube -l name=trustedpods --skip-deps |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
|
||
## Configure provider/in-cluster IPFS and publisher IPFS ## | ||
pkill -f "kubectl port-forward" | ||
pkill ipfs | ||
|
||
{ while ! kubectl get -n ipfs endpoints ipfs-rpc -o json | jq '.subsets[].addresses[].ip' &>/dev/null; do sleep 1; done; } | ||
|
||
O_IPFS_PATH=$IPFS_PATH | ||
export IPFS_PATH=$(mktemp ipfs.XXXX --tmpdir -d) | ||
|
||
[ "$PORT_5004" == "" ] && { PORT_5004="yes" ; kubectl port-forward --namespace ipfs svc/ipfs-rpc 5004:5001 & sleep 0.5; } | ||
echo /ip4/127.0.0.1/tcp/5004 > $IPFS_PATH/api | ||
|
||
SWARM_ADDRESSES=$(minikube service -n ipfs ipfs-swarm --url | head -n 1 | sed -E 's|http://(.+):(.+)|["/ip4/\1/tcp/\2", "/ip4/\1/udp/\2/quic", "/ip4/\1/udp/\2/quic-v1", "/ip4/\1/udp/\2/quic-v1/webtransport"]|') | ||
|
||
PROVIDER_IPFS=$(curl -X POST "http://127.0.0.1:5004/api/v0/id" | jq '.ID' -r); echo $PROVIDER_IPFS | ||
|
||
CONFIG_BEFORE=$(ipfs config Addresses.AppendAnnounce) | ||
ipfs config Addresses.AppendAnnounce --json "$SWARM_ADDRESSES" | ||
CONFIG_AFTER=$(ipfs config Addresses.AppendAnnounce) | ||
|
||
[ "$CONFIG_BEFORE" = "$CONFIG_AFTER" ] || kubectl delete -n ipfs $(kubectl get po -o name -n ipfs) # Restart ipfs daemon | ||
|
||
export IPFS_PATH=$O_IPFS_PATH | ||
|
||
{ while ! kubectl get -n ipfs endpoints ipfs-rpc -o json | jq '.subsets[].addresses[].ip' &>/dev/null; do sleep 1; done; } | ||
|
||
ipfs id &>/dev/null || ipfs init | ||
|
||
ipfs config --json Experimental.Libp2pStreamMounting true | ||
|
||
[ -n "$IPFS_DAEMON" ] || { IPFS_DAEMON=yes; ipfs daemon & { while ! [ -f ${IPFS_PATH:-~/.ipfs}/api ]; do sleep 0.1; done; } 2>/dev/null; } | ||
|
||
echo "$SWARM_ADDRESSES" | jq -r '.[] + "/p2p/'"$PROVIDER_IPFS"'"' | xargs -n 1 ipfs swarm connect || true | ||
|
||
sleep 5 | ||
|
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
7 changes: 5 additions & 2 deletions
7
test/e2e/autoscaler/manifest-autoscaler.yaml → test/e2e/common/manifest-autoscaler.yaml
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
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