R
RunPod4w ago
Miceo

runpodctl not found on pod

I wanted to run some tests. This involves a pod stopping itself after executing a task. To do this, I execute some work and then call runpodctl stop pod $RUNPOD_POD_ID inside the container from a bash script. This works in my actual production container, but it doesn't work in my test environment. The pod says that runpodctl can't be found (2024-06-11T13:56:58.504874269Z ./run.sh: line 11: runpodctl: not found). Even after letting it run for a while, it can't ever find runpodctl. Any idea what I can do about this? Here's a very minimal Dockerfile:
FROM alpine
COPY . .
RUN chmod +x run.sh
ENTRYPOINT ["./run.sh"]
FROM alpine
COPY . .
RUN chmod +x run.sh
ENTRYPOINT ["./run.sh"]
and the contents of run.sh:
#!/bin/sh

# wait for 10 seconds
for i in $(seq 20 -1 0); do
echo $i
sleep 1
done

# stop the pod
echo "Stopping the pod"
runpodctl stop pod $RUNPOD_POD_ID
#!/bin/sh

# wait for 10 seconds
for i in $(seq 20 -1 0); do
echo $i
sleep 1
done

# stop the pod
echo "Stopping the pod"
runpodctl stop pod $RUNPOD_POD_ID
cheers.
Solution:
runpodctl won't be installed on the alpine image by default
Jump to solution
13 Replies
Miceo
Miceo4w ago
PS: if there is another way to prevent pods from restarting after executing their task, I'd love to hear it!
Solution
digigoblin
digigoblin4w ago
runpodctl won't be installed on the alpine image by default
digigoblin
digigoblin4w ago
You can install it in your Dockerfile
# Install runpodctl
ARG RUNPODCTL_VERSION="v1.14.3"
RUN wget "https://github.com/runpod/runpodctl/releases/download/${RUNPODCTL_VERSION}/runpodctl-linux-amd64" -O runpodctl && \
chmod a+x runpodctl && \
mv runpodctl /usr/local/bin
# Install runpodctl
ARG RUNPODCTL_VERSION="v1.14.3"
RUN wget "https://github.com/runpod/runpodctl/releases/download/${RUNPODCTL_VERSION}/runpodctl-linux-amd64" -O runpodctl && \
chmod a+x runpodctl && \
mv runpodctl /usr/local/bin
Miceo
Miceo4w ago
Makes sense! will it automatically be authenticated? or would I have to set up manual authentication on the pod
digigoblin
digigoblin4w ago
I think you may have to setup auth, not sure
Miceo
Miceo4w ago
I'll have a look. Thanks! @digigoblin I tried doing it with ubuntu first, using the following compose file:
FROM ubuntu:22.04

COPY . .
RUN chmod +x run.sh

ENTRYPOINT ["./run.sh"]
FROM ubuntu:22.04

COPY . .
RUN chmod +x run.sh

ENTRYPOINT ["./run.sh"]
runpodctl is now defined, and the API key is injected, but looking at the runpod dashboard, I see the request is thrown with the following error: 2024-06-11T14:15:01.619304736Z Error: Post "https://api.runpod.io/graphql?api_key=XXXXXX": x509: certificate signed by unknown authority Any idea?
digigoblin
digigoblin4w ago
No clue, I am not an expert on runpodctl
nerdylive
nerdylive4w ago
Try another pod maybe Or also create a support ticket about that
digigoblin
digigoblin4w ago
I would log a github issue for it rather than support ticket
digigoblin
digigoblin4w ago
GitHub
GitHub - runpod/runpodctl: 🧰 | RunPod CLI for pod management
🧰 | RunPod CLI for pod management. Contribute to runpod/runpodctl development by creating an account on GitHub.
Miceo
Miceo4w ago
Issue persists. I'll be sure to flag it on GH. Thanks guys!
nerdylive
nerdylive4w ago
sure
justin
justin4w ago
runpodctl needs to be installed in the docker image, cannot expect a random docker image to just have it It’s a library not automatically provided by injecting it magically There is a lot of stuff under the hood that happens, u should use a docker image that uses a runpod official template as a base