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

Refactor images for old Mbed CLI 1 and Mbed CLI 2 #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

arekzaluski
Copy link
Collaborator

@arekzaluski arekzaluski commented Feb 24, 2021

Changes

  • Update Docker image for Mbed CLI 1
  • Update Docker image for Mbed CLI 2
  • Remove cmake from Mbed CLI 1
  • Add pyOCD to Mbed CLI 1 and Mbed CLI 2

WORKDIR /root
# Bootstrap
ADD bootstrap.sh /root
RUN sh /root/bootstrap.sh
Copy link
Member

Choose a reason for hiding this comment

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

I really dislike the change to a single command, a change to bootstrap.sh triggers a full rebuild and it is slow with multiarch. Whereas, with various RUN, actions made before the modification are cached.

Copy link
Contributor

Choose a reason for hiding this comment

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

I am agree with @pan- here, change it to a single command makes the huge docker image (1.4GB I think) into a single layer, every change will triggers a full rebuilding of whole layer. And this impair the benefit of the layer caching, and make the upload/download a slower process

Copy link
Contributor

Choose a reason for hiding this comment

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

Another point is if this bootstrap scripts calling other scripts make changes to the docker image contents, the it would be unclear what it is in the docker image.
One of major benefit of Dockerfile is : It is self-descriptive, by reading the Dockerfile, you know what it is inside image

Copy link
Collaborator

@LDong-Arm LDong-Arm Mar 3, 2021

Choose a reason for hiding this comment

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

The initial idea was to share one script for Docker and others (e.g. Vagrant), but I agree that performance (caching) should be prioritised.

It would be good to have this part reverted, while having other improvements (e.g. installing CMake via PPA) merged soon, so our CI (mainly Travis) can benefit from that.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Some Travis scripts currently still fetch the raw Ubuntu image and install stuff manually at the moment

Copy link
Collaborator

Choose a reason for hiding this comment

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

(By "reverted" I mean a separate PR - no need to abandon any work we've done here)


PARAMS="$PARAMS -it --rm"
PARAMS="$PARAMS -v $WORKSPACE:$PROJECT_DIR"
PARAMS="$PARAMS -p $PORT:8080"
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is exposed in port 8080?

WORKSPACE=${@:-$HOME}
PROJECT_DIR="/work/$(basename $WORKSPACE)"

PARAMS="$PARAMS -it --rm"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I actually think we do not need a a docker_run.sh. We can provide the whole "docker run" command encouraging user to understand what they are doing.

@@ -0,0 +1,5 @@
#!/usr/bin/env sh
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we really new a wrapper script? CI will be using "docker buildx" for building multi arch.

@saheerb
Copy link
Collaborator

saheerb commented Mar 10, 2021

I am trying to merge the changes to #7

  • I do not think there is a need for cmake, non cmake version. One image can have both CLI1 and 2.
  • bootstrap script etc, will not be used as mentioned in comments here.
  • docker build and run will not be copied for now, if there is a need we can do it later.
  • DockerFile in this PR and GitHub Actions for mbed-os-env image #7 will be compared and missing packages will be updated.
  • The readme looks good, I will copy that to GitHub Actions for mbed-os-env image #7

@arekzaluski @LDong-Arm anything else?

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.

6 participants