Skip to content
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

host-containers: extract git history to new repos and remove #751

Merged
merged 1 commit into from
Feb 19, 2020

Conversation

webern
Copy link
Member

@webern webern commented Feb 19, 2020

Issue

n/a

Description

Extract git history for bottlerocket-admin-container and bottlerocket-control-container and push these into new git repositories. Update Bottlerocket README.md to include paths to these repos when referenced.

Testing

Bottlerocket was built using cargo clean && cargo make world with success.

Methodology and New Repo Testing

TL;DR: Built the containers at develop~HEAD of each of the new repos and also asserted that the contents of each of these new repos matches Bottlerocket's develop~HEAD.

The exact methodology is described below.

Admin Container Repo Extraction

### Setup Filter Branches

cd $REPOS && \
rm -rf bottlerocket-admin-container && \
git clone git@github.com:bottlerocket-os/bottlerocket.git bottlerocket-admin-container && \
cd bottlerocket-admin-container && \
git remote remove origin && \
git checkout -b dockerfiles && \
git filter-branch --subdirectory-filter dockerfiles && \
git checkout develop && \
git checkout -b extras-control-container && \
git filter-branch -f --subdirectory-filter extras/control-container && \
git checkout develop && \
git checkout -b extras-admin-container && \
git filter-branch -f --subdirectory-filter extras/admin-container && \
git checkout develop && \
git checkout -b extras-host-containers-thar-admin && \
git filter-branch -f --subdirectory-filter extras/host-containers/thar-admin && \
git checkout develop && \
git checkout -b extras-host-containers-bottlerocket-admin && \
git filter-branch -f --subdirectory-filter extras/host-containers/bottlerocket-admin
git checkout develop

### Stitch together dockerfiles and extras/control-container

export CHILD_COMMIT=ccf9ac96ec616c9ebf51d9a8061a9cd209d2acb4
export PARENT_COMMIT=6e6816e16fc56471f54fc86513cf3013a5395442
git replace --graft $CHILD_COMMIT $PARENT_COMMIT

### Stitch together extras/control-container and extras/admin-container

export CHILD_COMMIT=a64f30fb0a0d550a5aaca649be3b9bdaf1340e9f
export PARENT_COMMIT=ad9cd809d4c780b11ed4730aeff2c3839ab86887
git replace --graft $CHILD_COMMIT $PARENT_COMMIT

### Stitch together extras/admin-container and extras/host-containers/thar-admin

export CHILD_COMMIT=b04453bd952c15f1257e4e6cfd245f8d900ea2b6
export PARENT_COMMIT=b5c29409f2ee229f5fa1af6a25b55843609e3d43
git replace --graft $CHILD_COMMIT $PARENT_COMMIT


### Stitch together extras/admin-container and extras/host-containers/thar-admin

export CHILD_COMMIT=54e8d6ce7d65b86e90341893aaea0ad042032eb3
export PARENT_COMMIT=401b9dffc67f0c4adc1e5fb9be4af986a5ef0f8d
git replace --graft $CHILD_COMMIT $PARENT_COMMIT

# push to the new repo
git remote add origin git@github.com:bottlerocket-os/bottlerocket-admin-container.git
git checkout extras-host-containers-bottlerocket-control
git filter-branch -f
git push origin extras-host-containers-bottlerocket-control:develop

# clone a fresh copy of the new repo
cd $REPOS
rm -rf bccnew
git clone git@github.com:bottlerocket-os/bottlerocket-admin-container.git bccnew
cd bccnew
git checkout develop

# combine two commits that both have the commit message:
# "Update host containers from Thar to Bottlerocket"
# And one of which was empty.
git rebase -i HEAD~5 
git push origin -f develop

Admin Container Repo Testing

# clone a fresh copy of the new repo and test building the control-container
cd $REPOS
rm -rf bottlerocket-admin-container
git clone git@github.com:bottlerocket-os/bottlerocket-admin-container.git
cd bottlerocket-admin-container
git checkout develop
git pull origin develop
docker container rm $(docker container ls -a -q) -f || true
docker network prune -f || true
docker rmi $(docker images -a -q) -f || true
make
## Success
docker image ls | grep bottlerocket
# bottlerocket-admin-container-amd64   v0.3-e146a932 ....

# diff the old and new directories
# let BR_DIR=bottlerocket git repo
# and REPOS/bottlerocket-admin-container=the new container repo
diff --brief --recursive --exclude=.git \
     "$BR_DIR/extras/host-containers/bottlerocket-admin" \
     "$REPOS/bottlerocket-admin-container"
# no output, exit 0

Control Container Repo Extraction

### Setup Filter Branches

cd $REPOS
rm -rf bottlerocket-control-container
git clone git@github.com:bottlerocket-os/bottlerocket.git bottlerocket-control-container
cd bottlerocket-control-container
git remote remove origin
git checkout -b dockerfiles
git filter-branch --subdirectory-filter dockerfiles
git checkout develop
git checkout -b extras-control-container
git filter-branch -f --subdirectory-filter extras/control-container
git checkout develop
git checkout -b extras-host-containers-thar-control
git filter-branch -f --subdirectory-filter extras/host-containers/thar-control
git checkout develop
git checkout -b extras-host-containers-bottlerocket-control
git filter-branch -f --subdirectory-filter extras/host-containers/bottlerocket-control
git checkout develop

### Stitch together dockerfiles and extras/control-container

export CHILD_COMMIT=ccf9ac96ec616c9ebf51d9a8061a9cd209d2acb4
export PARENT_COMMIT=6e6816e16fc56471f54fc86513cf3013a5395442
git replace --graft $CHILD_COMMIT $PARENT_COMMIT

### Stitch together extras/control-container and extras/host-containers/thar-control

export CHILD_COMMIT=88afef8414a6e577353991205f319e709de1cf88
export PARENT_COMMIT=ad9cd809d4c780b11ed4730aeff2c3839ab86887
git replace --graft $CHILD_COMMIT $PARENT_COMMIT

### Stitch together extras/host-containers/thar-control and extras/host-containers/bottlerocket-control

export CHILD_COMMIT=a29fa79131a5c2e26d36a7d3f320e9325eff7019
export PARENT_COMMIT=e8663909f2e867a9e26e0a2a2bcc723368d1f45c
git replace --graft $CHILD_COMMIT $PARENT_COMMIT


### Stitch together extras/admin-container and extras/host-containers/thar-control

# export CHILD_COMMIT=
# export PARENT_COMMIT=
# git replace --graft $CHILD_COMMIT $PARENT_COMMIT

# push to the new repo
git remote add origin git@github.com:bottlerocket-os/bottlerocket-control-container.git
git checkout extras-host-containers-bottlerocket-control
git filter-branch -f
git push origin extras-host-containers-bottlerocket-control:develop

# clone a fresh copy of the new repo
cd $REPOS
rm -rf bccnew
git clone git@github.com:bottlerocket-os/bottlerocket-control-container.git bccnew
cd bccnew
git checkout develop

# combine two commits that both have the commit message:
# "Update host containers from Thar to Bottlerocket"
# And one of which was empty.
git rebase -i HEAD~5
git push origin -f develop

Control Container Repo Testing

# clone a fresh copy of the new repo and test building the control-container
cd $REPOS
rm -rf bottlerocket-control-container
git clone git@github.com:bottlerocket-os/bottlerocket-control-container.git
cd bottlerocket-control-container
git checkout develop
git pull origin develop
docker container rm $(docker container ls -a -q) -f || true
docker network prune -f || true
docker rmi $(docker images -a -q) -f || true
make
## Success
docker image ls | grep bottlerocket
# bottlerocket-control-container-amd64   v0.3-7e03982c ...

# diff the old and new directories
# let BR_DIR=bottlerocket git repo
# and REPOS/bottlerocket-control-container=the new container repo
diff --brief --recursive --exclude=.git \
     "$BR_DIR/extras/host-containers/bottlerocket-control" \
     "$REPOS/bottlerocket-control-container"
# no output, exit 0

Copy link
Contributor

@zmrow zmrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💴

@webern webern merged commit 750d48d into develop Feb 19, 2020
@tjkirch tjkirch deleted the extract-host-containers branch February 21, 2020 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants