Skip to content

Commit

Permalink
attempt to build fprime projects on dedicated image without pushing
Browse files Browse the repository at this point in the history
  • Loading branch information
capsulecorplab committed Mar 30, 2024
1 parent 595e740 commit 4151604
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@ jobs:
- name: Checkout github repo
uses: actions/checkout@v4

- name: Workaround to free up 5GB of space # see https://github.com/actions/runner-images/issues/709#issuecomment-612569242
run: sudo rm -rf "/usr/local/share/boost" && sudo rm -rf "$AGENT_TOOLSDIRECTORY"

- name: Show disk usage before build
run: df -h

- name: Build image with fprime projects
uses: docker/build-push-action@v5
with:
file: ./fprime-projects.Dockerfile

- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v4
Expand All @@ -59,12 +70,18 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Show disk usage before build
run: df -h

- name: Build image
uses: docker/build-push-action@v5
with:
tags: ${{ steps.docker_meta.outputs.tags }}
file: ./Dockerfile

- name: Show disk usage before build
run: df -h

- name: Push image
uses: docker/build-push-action@v5
with:
Expand Down
43 changes: 43 additions & 0 deletions fprime-projects.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
FROM kasmweb/core-ubuntu-jammy:1.13.0
USER root

LABEL org.opencontainers.image.source="https://github.com/fprime-community/fprime-workspace-image"

ENV HOME /home/kasm-default-profile
ENV STARTUPDIR /dockerstartup
ENV INST_SCRIPTS $STARTUPDIR/install
WORKDIR $HOME

######### Customize Container Here ###########

# copy over install_files/ for use in playbooks
ADD install_files $HOME/install_files

# install Ansible per
# https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#installing-ansible-on-ubuntu
RUN apt update && apt -y install software-properties-common && add-apt-repository --yes --update ppa:ansible/ansible && apt install -y ansible && rm -rf /var/lib/apt/lists/*

# run Ansible commands
COPY ./requirements.yaml ./playbook.yaml ./
RUN ansible-galaxy install -r requirements.yaml && ansible-playbook -i,localhost playbook.yaml --tags "build_led_blinker, build_baremetal_reference" && rm -f ./*.yaml

# Custom Desktop Background - replace ingenuity_helicopter_on_mars.png on disk with your own background image
COPY ./ingenuity_helicopter_on_mars.png /usr/share/extra/backgrounds/bg_default.png

# Create .profile and set XFCE terminal to use it
RUN cp /etc/skel/.profile $HOME/.profile && mkdir $HOME/.config/xfce4/terminal/
COPY ./terminalrc /home/kasm-default-profile/.config/xfce4/terminal/terminalrc

# clean up install_files/
RUN rm -rf $HOME/install_files/

######### End Customizations ###########

RUN chown 1000:0 $HOME
RUN $STARTUPDIR/set_user_permission.sh $HOME

ENV HOME /home/kasm-user
WORKDIR $HOME
RUN mkdir -p $HOME && chown -R 1000:0 $HOME

USER 1000

0 comments on commit 4151604

Please sign in to comment.