Skip to content

Commit

Permalink
Merge pull request #8393 from Agoric/drop-tmux
Browse files Browse the repository at this point in the history
test: remove tmux from upgrade-tests
  • Loading branch information
mergify[bot] authored Sep 27, 2023
2 parents 31ed402 + 0ecffd2 commit 4ffd2ad
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 49 deletions.
19 changes: 9 additions & 10 deletions packages/deployment/upgrade-test/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN echo "${BOOTSTRAP_MODE}"
RUN mkdir -p /usr/src/agoric-sdk/upgrade-test-scripts
WORKDIR /usr/src/agoric-sdk/
COPY ./start_ag0.sh ./upgrade-test-scripts/
COPY ./bash_entrypoint.sh ./env_setup.sh ./start_to_to.sh ./upgrade-test-scripts/
COPY ./env_setup.sh ./start_to_to.sh ./upgrade-test-scripts/
SHELL ["/bin/bash", "-c"]
# this is the only layer that starts ag0
RUN . ./upgrade-test-scripts/start_ag0.sh
Expand All @@ -37,7 +37,7 @@ COPY --from=agoric-upgrade-7-2 /root/.agoric /root/.agoric

# boilerplate to copy scripts for this upgrade
WORKDIR /usr/src/agoric-sdk/
COPY ./bash_entrypoint.sh ./env_setup.sh ./start_to_to.sh ./upgrade-test-scripts/
COPY ./env_setup.sh ./start_to_to.sh ./upgrade-test-scripts/
COPY ./${THIS_NAME} ./upgrade-test-scripts/${THIS_NAME}/
RUN chmod +x ./upgrade-test-scripts/*.sh
SHELL ["/bin/bash", "-c"]
Expand All @@ -50,7 +50,7 @@ FROM ghcr.io/agoric/agoric-sdk:30 as agoric-upgrade-8-1
ARG BOOTSTRAP_MODE UPGRADE_INFO_9
ENV THIS_NAME=agoric-upgrade-8-1 UPGRADE_TO=agoric-upgrade-9 UPGRADE_INFO=${UPGRADE_INFO_9} BOOTSTRAP_MODE=${BOOTSTRAP_MODE}
WORKDIR /usr/src/agoric-sdk/
COPY ./bash_entrypoint.sh ./env_setup.sh ./start_to_to.sh ./upgrade-test-scripts/
COPY ./env_setup.sh ./start_to_to.sh ./upgrade-test-scripts/
COPY ./${THIS_NAME} ./upgrade-test-scripts/${THIS_NAME}/
COPY --from=agoric-upgrade-8 /root/.agoric /root/.agoric
RUN chmod +x ./upgrade-test-scripts/*.sh
Expand All @@ -65,7 +65,7 @@ ARG BOOTSTRAP_MODE UPGRADE_INFO_10
ENV THIS_NAME=agoric-upgrade-9 UPGRADE_TO=agoric-upgrade-10 UPGRADE_INFO=${UPGRADE_INFO_10} BOOTSTRAP_MODE=${BOOTSTRAP_MODE}

WORKDIR /usr/src/agoric-sdk/
COPY ./bash_entrypoint.sh ./env_setup.sh ./start_to_to.sh ./upgrade-test-scripts/
COPY ./env_setup.sh ./start_to_to.sh ./upgrade-test-scripts/
COPY ./${THIS_NAME} ./upgrade-test-scripts/${THIS_NAME}/
COPY --from=agoric-upgrade-8-1 /root/.agoric /root/.agoric
WORKDIR /usr/src/agoric-sdk/
Expand All @@ -81,7 +81,7 @@ ARG BOOTSTRAP_MODE
ENV THIS_NAME=agoric-upgrade-10 USE_JS=1 BOOTSTRAP_MODE=${BOOTSTRAP_MODE}

WORKDIR /usr/src/agoric-sdk/
COPY ./bash_entrypoint.sh ./env_setup.sh ./start_to_to.sh ./package.json ./*.js ./upgrade-test-scripts/
COPY ./env_setup.sh ./start_to_to.sh ./package.json ./*.js ./upgrade-test-scripts/
RUN cd upgrade-test-scripts && yarn
RUN echo '. /usr/src/agoric-sdk/upgrade-test-scripts/env_setup.sh' >> ~/.bashrc

Expand All @@ -99,7 +99,7 @@ FROM ghcr.io/agoric/agoric-sdk:35 as propose-agoric-upgrade-11
ARG BOOTSTRAP_MODE UPGRADE_INFO_11
ENV THIS_NAME=propose-agoric-upgrade-11 UPGRADE_TO=agoric-upgrade-11 UPGRADE_INFO=${UPGRADE_INFO_11} BOOTSTRAP_MODE=${BOOTSTRAP_MODE}
WORKDIR /usr/src/agoric-sdk/
COPY ./bash_entrypoint.sh ./env_setup.sh ./start_to_to.sh ./upgrade-test-scripts/
COPY ./env_setup.sh ./start_to_to.sh ./upgrade-test-scripts/
RUN cd upgrade-test-scripts && yarn
RUN echo '. /usr/src/agoric-sdk/upgrade-test-scripts/env_setup.sh' >> ~/.bashrc

Expand All @@ -117,7 +117,7 @@ ARG BOOTSTRAP_MODE
ENV THIS_NAME=agoric-upgrade-11 BOOTSTRAP_MODE=${BOOTSTRAP_MODE} USE_JS=1
# start-chain boilerplate
WORKDIR /usr/src/agoric-sdk/
COPY ./bash_entrypoint.sh ./env_setup.sh ./start_to_to.sh ./package.json ./*.js ./upgrade-test-scripts/
COPY ./env_setup.sh ./start_to_to.sh ./package.json ./*.js ./upgrade-test-scripts/
RUN cd upgrade-test-scripts && yarn
RUN echo '. /usr/src/agoric-sdk/upgrade-test-scripts/env_setup.sh' >> ~/.bashrc

Expand All @@ -136,7 +136,7 @@ ENV THIS_NAME=propose-agoric-upgrade-12 UPGRADE_TO=agoric-upgrade-12 UPGRADE_INF
COPY --from=agoric-upgrade-11 /root/.agoric /root/.agoric
# start-chain boilerplate
WORKDIR /usr/src/agoric-sdk/
COPY ./bash_entrypoint.sh ./env_setup.sh ./start_to_to.sh ./upgrade-test-scripts/
COPY ./env_setup.sh ./start_to_to.sh ./upgrade-test-scripts/
RUN cd upgrade-test-scripts && yarn
RUN echo '. /usr/src/agoric-sdk/upgrade-test-scripts/env_setup.sh' >> ~/.bashrc

Expand All @@ -154,12 +154,11 @@ ENV THIS_NAME=agoric-upgrade-12 BOOTSTRAP_MODE=${BOOTSTRAP_MODE}
COPY --from=propose-agoric-upgrade-12 /root/.agoric /root/.agoric
# start-chain boilerplate
WORKDIR /usr/src/agoric-sdk/
COPY ./bash_entrypoint.sh ./env_setup.sh ./start_to_to.sh ./package.json ./*.js ./upgrade-test-scripts/
COPY ./env_setup.sh ./start_to_to.sh ./package.json ./*.js ./upgrade-test-scripts/
RUN cd upgrade-test-scripts && yarn
RUN echo '. /usr/src/agoric-sdk/upgrade-test-scripts/env_setup.sh' >> ~/.bashrc

COPY ./${THIS_NAME} ./upgrade-test-scripts/${THIS_NAME}/
RUN apt install -y tmux
SHELL ["/bin/bash", "-c"]
RUN chmod +x ./upgrade-test-scripts/*.sh
# enter image in interactive shell
Expand Down
10 changes: 4 additions & 6 deletions packages/deployment/upgrade-test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ else
endif
TARGET?=agoric-upgrade-12
dockerLabel?=$(TARGET)
ifdef TMUX_CC
tmuxCC=1
else
tmuxCC=0
endif
@echo target: $(TARGET)

local_sdk:
Expand Down Expand Up @@ -64,7 +59,7 @@ RUN = docker run --rm -it \
-e "DEBUG=$(DEBUG)"

run:
$(RUN) -e "DEST=1" -e "TMUX_USE_CC=$(tmuxCC)" \
$(RUN) -e "DEST=1" \
--entrypoint /usr/src/agoric-sdk/upgrade-test-scripts/start_to_to.sh \
$(REPOSITORY):$(dockerLabel)

Expand All @@ -74,4 +69,7 @@ run_test:
run_bash:
$(RUN) --entrypoint /bin/bash $(REPOSITORY):$(dockerLabel)

shell:
docker exec -it `docker ps --latest --format json | jq -r .Names` bash

.PHONY: local_sdk agoric-upgrade-7-2 agoric-upgrade-8 agoric-upgrade-8-1 agoric-upgrade-9 agoric-upgrade-10 agoric-upgrade-11 agoric-upgrade-12 build build_test run
19 changes: 9 additions & 10 deletions packages/deployment/upgrade-test/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,13 @@ make local_sdk build
make run
```

This will start a container with tmux, with the first window `0` being chain logs `agd start` and the second and current window `1` being a bash shell. You can navigate using `bind-key+B N` (assuming `bind-key` is CTRL/CMD) and N is the window. For more shortcuts see [tmux shortcuts & cheatsheet](https://gist.github.com/MohamedAlaa/2961058#list-all-shortcuts).
This will start a container with the output of chain start.

The container and chain will halt once you detach from the session.

### Using tmux control mode

If you use [iTerm you can use tmux with native integration](https://iterm2.com/documentation-tmux-integration.html), called control mode, which will make your tmux session appear as a physical window. Pass `TMUX_CC=1`:
To get a shell: `make shell`

```shell
TMUX_CC=1 make run
```
For more info: https://phase2.github.io/devtools/common-tasks/ssh-into-a-container/

**Note:** If your terminal does not support control mode, do not use this. It will show raw control codes, garbling your terminal.
The container and chain will halt once you detach from the session.

### Troubleshooting
If you get an error about port 26656 already in use, you have a local chain running on your OS.
Expand Down Expand Up @@ -96,6 +90,11 @@ If when reattaching you get a log tail, you need to start a new TTY (with the co
docker exec -it sweet_edison bash
```

or just use this helper,
```
make shell
```


**To test GUI**

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,10 @@
grep -qF 'env_setup.sh' /root/.bashrc || echo ". ./upgrade-test-scripts/env_setup.sh" >> /root/.bashrc
grep -qF 'printKeys' /root/.bashrc || echo "printKeys" >> /root/.bashrc

tmux -V 2>/dev/null || apt-get install -y tmux

if [[ "$DEST" == "1" ]] && [[ "$TMUX" == "" ]]; then
echo "launching entrypoint"
cd /usr/src/agoric-sdk || exit 1
. ./upgrade-test-scripts/bash_entrypoint.sh
exit 0
fi

. ./upgrade-test-scripts/env_setup.sh

export SLOGFILE=slog.slog

startAgd

if ! test -f "$HOME/.agoric/runActions-${THIS_NAME}"; then
Expand Down Expand Up @@ -82,4 +75,4 @@ if [[ "$DEST" != "1" ]]; then
else

waitAgd
fi
fi

0 comments on commit 4ffd2ad

Please sign in to comment.