-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: use temp file to write config #174
Conversation
f15cb45
to
6ff6b8a
Compare
6ff6b8a
to
4013e2b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for creating PR. I left nits comments. Would you take a look at them?
8e14437
to
01887ac
Compare
I came up with the case where the
(A) virt-install -n dynein_check -r 8192 \
--disk path=$HOME/vm/dynein_root.img,bus=virtio,size=20 \
--disk path=$HOME/vm/dynein_home.img,bus=virtio,size=20 \
-c ubuntu-22.04.3-live-server-amd64.iso \
--network network=default,model=virtio \
--graphics vnc,listen=0.0.0.0 --noautoconsole -v --vcpus=2 (B)
(C) curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Use default installation
source "$HOME/.cargo/env"
sudo apt-get update
sudo apt install git gcc pkg-config libssl-dev docker -y
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu jammy stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
git clone https://github.com/awslabs/dynein.git
cd dynein
sudo docker run -p 8000:8000 -d amazon/dynamodb-local
export RUST_BACKTRACE=1
export AWS_ACCESS_KEY_ID=test
export AWS_SECRET_ACCESS_KEY=test
cargo run ls -r local
cargo run admin create table test1 --keys pk -r local
cargo run use test -r local
# These should succeed
git remote add ryota-sakamoto https://github.com/ryota-sakamoto/dynein.git
git fetch --all
git checkout ryota-sakamoto/fix-generate-config
cargo run ls -r local
cargo run admin create table test2 --keys pk -r local
cargo run use test2 -r local This causes the following error;
|
01887ac
to
bca2a2b
Compare
@StoneDot |
bca2a2b
to
67f2034
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the improvement. LGTM
Issue #, if available:
#172
Description of changes:
We use temp file to generate default config. Because while fs::write is writing the contents to default config path, serde_yaml::from_str return EndOfStream.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.