Skip to content

Commit

Permalink
addition files to touch for personal prow setup (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
rcrozean authored Dec 20, 2023
1 parent 9a32e9d commit d739431
Show file tree
Hide file tree
Showing 4 changed files with 142 additions and 147 deletions.
237 changes: 118 additions & 119 deletions jobs/presets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,122 +13,121 @@
# limitations under the License.

presets:
- labels:
pr-creation: "true"
volumeMounts:
- name: github-auth
mountPath: /secrets/github-secrets
readOnly: true
- name: ssh-auth
mountPath: /secrets/ssh-secrets
readOnly: true
volumes:
- name: github-auth
secret:
secretName: pr-bot-github-token
defaultMode: 256
- name: ssh-auth
secret:
secretName: pr-bot-ssh-secret
defaultMode: 256
- labels:
local-registry: "true"
volumeMounts:
- name: registry-entrypoint
readOnly: false
mountPath: /registry-script
- name: docker-registry-data
readOnly: false
mountPath: /var/lib/registry
volumes:
- name: registry-entrypoint
configMap:
name: registry-entrypoint
items:
- key: registry-entrypoint.sh
path: entrypoint.sh
- name: docker-registry-data
emptyDir: {}
- labels:
disk-usage: "true"
volumeMounts:
- name: go-build-cache
readOnly: false
mountPath: /root/.cache/go-build
- name: disk-usage-entrypoint
readOnly: false
mountPath: /disk-usage-script
volumes:
- name: go-build-cache
emptyDir: {}
- name: disk-usage-entrypoint
configMap:
name: disk-usage-entrypoint
items:
- key: disk-usage-entrypoint.sh
path: entrypoint.sh
- labels:
image-build: "true"
env:
- name: AWS_SDK_LOAD_CONFIG
value: "true"
volumeMounts:
- name: docker-registry-config
mountPath: /root/.docker/config.json
subPath: config.json
- name: run-buildkit
readOnly: false
mountPath: /run/buildkit
- name: entrypoint
readOnly: false
mountPath: /script
- name: buildkitd-data
readOnly: false
mountPath: /home/user/.local/share/buildkit
volumes:
# The files in this repo update the respective configmaps
# via the config-updater plugin in plugins.yaml for hook
- name: docker-registry-config
configMap:
name: build-setup
items:
- key: docker-ecr-config.json
path: config.json
- name: entrypoint
configMap:
name: buildkitd-entrypoint
items:
- key: buildkitd-entrypoint.sh
path: entrypoint.sh
- name: run-buildkit
emptyDir: {}
- name: buildkitd-data
emptyDir: {}
- env:
- name: AWS_ROLE_SESSION_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: GOPROXY
value: "http://athens-proxy.default.svc.cluster.local"
- name: FARGATE_PROFILE_NAME
valueFrom:
fieldRef:
fieldPath: metadata.labels['eks.amazonaws.com/fargate-profile']
volumes:
- name: builder-base-tag-file
configMap:
name: builder-base-tag-file
items:
- key: BUILDER_BASE_TAG_FILE
path: BUILDER_BASE_TAG_FILE
- name: status
emptyDir: {}
volumeMounts:
- name: builder-base-tag-file
readOnly: false
mountPath: /config
- name: status
readOnly: false
mountPath: /status

- labels:
pr-creation: "true"
volumeMounts:
- name: github-auth
mountPath: /secrets/github-secrets
readOnly: true
- name: ssh-auth
mountPath: /secrets/ssh-secrets
readOnly: true
volumes:
- name: github-auth
secret:
secretName: pr-bot-github-token
defaultMode: 256
- name: ssh-auth
secret:
secretName: pr-bot-ssh-secret
defaultMode: 256
- labels:
local-registry: "true"
volumeMounts:
- name: registry-entrypoint
readOnly: false
mountPath: /registry-script
- name: docker-registry-data
readOnly: false
mountPath: /var/lib/registry
volumes:
- name: registry-entrypoint
configMap:
name: registry-entrypoint
items:
- key: registry-entrypoint.sh
path: entrypoint.sh
- name: docker-registry-data
emptyDir: {}
- labels:
disk-usage: "true"
volumeMounts:
- name: go-build-cache
readOnly: false
mountPath: /root/.cache/go-build
- name: disk-usage-entrypoint
readOnly: false
mountPath: /disk-usage-script
volumes:
- name: go-build-cache
emptyDir: {}
- name: disk-usage-entrypoint
configMap:
name: disk-usage-entrypoint
items:
- key: disk-usage-entrypoint.sh
path: entrypoint.sh
- labels:
image-build: "true"
env:
- name: AWS_SDK_LOAD_CONFIG
value: "true"
volumeMounts:
- name: docker-registry-config
mountPath: /root/.docker/config.json
subPath: config.json
- name: run-buildkit
readOnly: false
mountPath: /run/buildkit
- name: entrypoint
readOnly: false
mountPath: /script
- name: buildkitd-data
readOnly: false
mountPath: /home/user/.local/share/buildkit
volumes:
# The files in this repo update the respective configmaps
# via the config-updater plugin in plugins.yaml for hook
- name: docker-registry-config
configMap:
name: build-setup
items:
- key: docker-ecr-config.json
path: config.json
- name: entrypoint
configMap:
name: buildkitd-entrypoint
items:
- key: buildkitd-entrypoint.sh
path: entrypoint.sh
- name: run-buildkit
emptyDir: {}
- name: buildkitd-data
emptyDir: {}
- env:
- name: AWS_ROLE_SESSION_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: GOPROXY
value: "http://athens-proxy.default.svc.cluster.local"
- name: FARGATE_PROFILE_NAME
valueFrom:
fieldRef:
fieldPath: metadata.labels['eks.amazonaws.com/fargate-profile']
volumes:
- name: builder-base-tag-file
configMap:
name: builder-base-tag-file
items:
- key: BUILDER_BASE_TAG_FILE
path: BUILDER_BASE_TAG_FILE
- name: status
emptyDir: {}
volumeMounts:
- name: builder-base-tag-file
readOnly: false
mountPath: /config
- name: status
readOnly: false
mountPath: /status
6 changes: 2 additions & 4 deletions scripts/buildkitd-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ rootlesskit \
--oci-worker-gc-keepstorage $KEEP_STORAGE \
&
pid=$!
while [ ! -f /status/done ]
do
sleep 5
while [ ! -f /status/done ]; do
sleep 5
done
kill $pid

39 changes: 19 additions & 20 deletions scripts/disk-usage-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,26 @@
# Run registry in background mode to be able to poll
# for the done status file and kill process after


while [ ! -f /status/done ]; do
echo -e "-------------------------------------------------------------------------------------------------"

for folder in "/root/.cache/go-build" "/home/prow/go/pkg/mod" "/home/user/.local/share/buildkit" "/var/lib/registry" "/tmp"; do
if [ -d $folder ]; then
du -sh $folder 2> /dev/null
fi
done
echo -e "-------------------------------------------------------------------------------------------------"

for folder in "/root/.cache/go-build" "/home/prow/go/pkg/mod" "/home/user/.local/share/buildkit" "/var/lib/registry" "/tmp"; do
if [ -d $folder ]; then
du -sh $folder 2>/dev/null
fi
done

for folder in "/home/prow/go/src/github.com/aws"; do
if [ -d $folder ]; then
echo -e "\n--------------- $folder -------------------"
du -Sh $folder 2>/dev/null | sort -rh | head -10
du -sh $folder 2>/dev/null
echo -e "--------------- $folder -------------------\n"
fi
done

for folder in "/home/prow/go/src/github.com/aws"; do
if [ -d $folder ]; then
echo -e "\n--------------- $folder -------------------"
du -Sh $folder 2> /dev/null | sort -rh | head -10
du -sh $folder 2> /dev/null
echo -e "--------------- $folder -------------------\n"
fi
done
df -h
echo -e "-------------------------------------------------------------------------------------------------\n"

df -h
echo -e "-------------------------------------------------------------------------------------------------\n"

sleep 20
sleep 20
done
7 changes: 3 additions & 4 deletions scripts/registry-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@
# Run registry in background mode to be able to poll
# for the done status file and kill process after

registry serve /etc/docker/registry/config.yml &
registry serve /etc/docker/registry/config.yml &
pid=$!
while [ ! -f /status/done ]
do
sleep 5
while [ ! -f /status/done ]; do
sleep 5
done
kill $pid

0 comments on commit d739431

Please sign in to comment.