WangJL's Blog

Week 5 Blog Post

WangJL
Published: 07/31/2020

I am not feeling well this week and have asked for leave this week with my mentors. I will catch up with my plan on this weekend or next week. 

View Blog Post

Week 5 Check-in

WangJL
Published: 07/25/2020

What I have done this week

1. Fixed the bug. The shell script parser exits while parsing complex RUN command. After debugging, I found that function consolidate_commands()  will have a dead loop in this case. So I updated the logic in this function to fix it.

2. Build multistage dockerfile. I splited the multistage dockerfile into seperate dockerfiles for building. My mentor has reviewed on my draft code, the logic is right but the implementation should be better.

To Do

1. Finishing the part of multistage dockerfile building part. Improve the draft code.

2. Recognize install snippets that follow environment variable declarations. Issue 770.

Did I get stuck somewhere?

To perform the analysis on multistage dockerfile, i need to learn about how Tern deals with a simple Dockerfile. This is relative to my function designing of the analysis on multistage dockerfile. For now, i have a basic understanding, i need to go deeper while working on analysis on multistage dockerfile.

View Blog Post

Week 4 Blog Post

WangJL
Published: 07/18/2020

What I have done this week

1. Give a detailed plan on analyzing multistage dockerfile and work on step1 which is spliting a multistage dockerfile by 'FROM'.

2. Add report on branching command.

TO DO

1. A bug comes with issue #772, tern exists with error while parsing a complicated RUN command. Fix this issue.

2. Work on analyzing multistage dockerfile.

 

View Blog Post

Week 4 Check-in

WangJL
Published: 07/12/2020

What i have done this week

Updating functions to implement a shell script parser for the RUN command. 

1. split_command(): Splite a shell script into statements: variable, command, branch and loop.

2. get_shell_commands(): Traverse the statements to pick out command and command in the loop.

3. clean_command(): Remove the tab, line inditation and long whitespaces in the command.

This PR has been merged, and at the end of week I add a report for branch statement which is previously skipped during parse.

With discussion with my mentor, we are now done with the main part of shell script parser. And next week we will move on to another issue. 

To do

Perform analysis on multistage Dockerfiles, issue#612.

Here are the steps:

1. Split the Dockerfile by stage, making a single Dockerfile for each stage

2. Build and analyze each stage

3. For reporting, perhaps organize each stage as a different section and indicate that each is a build stage of the next. Pinning a multistage Dockerfile is straightforward.

Implement the first step this week.

Did i get stuck somewhere?

No.

View Blog Post

Week 3 Blog Post

WangJL
Published: 07/09/2020

Sorry for the late post.

What i have done this week

During the test for the parse command function, i find that there are long whitespaces that will be parse as package name. So i use shlex to remove long whitespaces.

First use shlex to split into seperate words, and then use space to join them( ' '.join(shlex.split(command)) ), this will remove long whitespaces, tab and line inditations.

TO DO

After discussion with my mentor, we are now at the final step of the shell script parser which is updating the functions to enable this parser in the tern.

Did i get stuck somewhere?

No.

View Blog Post