-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.Rmd
322 lines (251 loc) · 11.6 KB
/
main.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
---
title: "(Very) Preliminary Study of the Longevity of Docker Images from Research Artifacts"
author: Quentin Guilloteau
geometry: margin=20mm
numbersections: true
bibliography: references.bib
---
```{r, include=F}
#
library(tidyverse)
library(slider)
```
```{r}
df <- read_csv("./outputs/aggregated/europar24/pkgs.csv", col_names = c("pkg", "version", "tool", "artifact", "date")) %>%
mutate(date = date(as_datetime(date))) %>%
drop_na()
df
```
# Introduction
- Reproducibility crisis
- Artifact evaluation in conferences
- Software environment is a problem/difficul aspect
- conferences recommand to use containers to share the software environmnent
- but container recipes are based on non-reproducibile tools (package managers and bad practices) @guilloteau:hal-04562691
- trade-off between storing the result of the image builts by the authors and the recipe
This paper proposes a framework to evaluate the variations in resulting software environment produced by `Dockerfile`s from research artifacts.
We show initial results from five `Dockerfile`s built every month for six months.
# Methodology
In this paper, we build Docker images coming from `r length(unique(df$artifact))` artifacts of the EuroPar'24 conference.
We built each image on `r length(unique(df$date))` dates roughtly one month apart (`r unique(df$date)`).
We aim to answer the following questions:
1. How does the packages evolve through time when captured in a `Dockerfile`?
2. Which packaging tool is the most victim to variation in its resulting software environment?
3. Which are the most volatile packages?
The goal is not to dunk on authors or conferences, but simply to exhibit the potential issues with `Dockerfile`s.
# Framework
- `ecg`
- architecture (nickel, what is supported)
- process (submit new artifacts)
- end goal of the project
# Results
This section presents the information we would like to extract from the data gathered.
```{r}
df %>%
group_by(pkg, tool, artifact) %>%
summarize(n = n_distinct(version)) %>%
arrange(desc(n)) %>%
ggplot(aes(x = n, color = tool)) +
stat_ecdf() +
xlim(1, NA) +
xlab("Number of different versions") +
facet_wrap(~artifact) +
theme_bw()
```
```{r}
first_dates <- df %>%
group_by(artifact) %>%
summarize(first_date = min(date))
first_date_versions <- df %>%
left_join(first_dates) %>%
filter(first_date == date) %>%
rename(first_version = version) %>%
select(first_date, pkg, first_version, artifact)
df %>%
left_join(first_date_versions) %>%
mutate(is_same_as_first_date = version == first_version) %>%
select(date, pkg, artifact, tool, is_same_as_first_date) %>%
group_by(artifact, date) %>%
mutate(total_pkgs = n()) %>%
group_by(artifact, date, is_same_as_first_date, total_pkgs) %>%
summarize(total = n()) %>%
ggplot(aes(x = factor(date), y = 100 * total / total_pkgs, fill = is_same_as_first_date)) +
geom_col() +
# geom_text(data = .%>% filter(is_same_as_first_date), aes(y = (100 * total/total_pkgs) - 1.5, label = paste(round(100*total/total_pkgs, digits=1), "%",sep="")), angle=0, size=1.6) +
geom_text(data = .%>% filter(is_same_as_first_date), aes(y = (100 * total/total_pkgs) - 2, label = total), angle=0, size=2.0) +
geom_text(data = .%>% filter(is_same_as_first_date), aes(y = (100 * total/total_pkgs) + 2, label = total_pkgs - total), angle=0, size=2.0) +
#geom_hline(yintercept = 85, linetype="dashed") +
xlab("Dates of builds (YYYY-MM-DD)") +
ylab("Percentage of the packages [%]") +
scale_fill_discrete("Are the versions of the packages the same as the initial build?", breaks = c(TRUE, FALSE), labels = c("Yes", "No")) +
facet_wrap(~artifact, ncol = 5) +
ggtitle("Evolution of the packages versions through time") +
theme_bw() +
theme(axis.text.x = element_text(angle = 45, hjust = 1), legend.position = "bottom")
```
```{r}
ndf <- df %>%
group_by(artifact, tool, pkg) %>%
arrange(date) %>%
nest()
xx <- ndf %>%
rowwise() %>%
mutate(data2 = list(data %>% arrange(date) %>% mutate(rank = .$date[match(version, .$version)]))) %>%
select(-data) %>%
unnest_wider(data2) %>%
unnest_longer(c("version", "date", "rank"))
dates <- xx %>% pull(date) %>% unique()
xx %>%
group_by(artifact, date) %>%
mutate(total_pkgs = n()) %>%
group_by(artifact, date, rank, total_pkgs) %>%
summarize(total = n()) %>%
mutate(rank = factor(rank)) %>%
mutate(rank = factor(rank, levels=rev(levels(rank)))) %>%
ggplot(aes(x = factor(date), y = 100 * total / total_pkgs, fill = rank)) +
geom_col() +
# geom_text(data = .%>% filter(is_same_as_first_date), aes(y = (100 * total/total_pkgs) - 1.5, label = paste(round(100*total/total_pkgs, digits=1), "%",sep="")), angle=0, size=1.6) +
#geom_hline(yintercept = 85, linetype="dashed") +
geom_text(data = . %>% filter(as.character(rank) == dates[1]), aes(y = (100 * total/total_pkgs) - 5, label = total), angle=0, size=2.0) +
geom_text(data = . %>% filter(as.character(rank) == dates[1]), aes(y = (100 * total/total_pkgs) - 10, label = paste("(",round(100*total/total_pkgs, digits = 1), "%)",sep="")), angle=0, size=1.5) +
#xlab("Dates of builds (YYYY-MM-DD)") +
ylab("Packages in environment [%]") +
facet_wrap(~artifact, ncol = 5) +
ggtitle("Evolution of the packages versions through time") +
scale_fill_grey("Month when the package version was introduced in the environment", labels=rev(append(c("Initial"), seq(length(dates)-1))))+
scale_x_discrete("Months after initial build", labels=append(c("Initial"), seq(length(dates)-1))) +
#scale_fill_grey() +
theme_bw() +
theme(legend.position = "bottom", strip.background = element_blank())
#theme(axis.text.x = element_text(angle = 45, hjust = 1), legend.position = "bottom", strip.background = element_blank())
ggsave("rep24/fig.png", width=8, height=3.5)
```
```{r}
ps <- df %>%
left_join(first_date_versions) %>%
mutate(is_same_as_first_date = version == first_version) %>%
select(date, pkg, artifact, tool, is_same_as_first_date) %>%
group_by(artifact, date) %>%
mutate(total_pkgs = n()) %>%
group_by(artifact, date, is_same_as_first_date, total_pkgs) %>%
summarize(total = n()) %>%
mutate(r = total / total_pkgs) %>%
filter(is_same_as_first_date) %>%
select(-total_pkgs, -total, -is_same_as_first_date) %>%
ungroup() %>%
group_by(artifact) %>%
mutate(p = r / lag(r)) %>%
drop_na() %>%
select(artifact, p)
qqnorm(ps$p, main='Normal')
qqline(ps$p)
ks.test(ps$p, 'pnorm')
summary(ps$p)
```
```{r}
df %>%
left_join(first_date_versions) %>%
mutate(is_same_as_first_date = version == first_version) %>%
select(date, pkg, artifact, tool, is_same_as_first_date) %>%
group_by(artifact, tool, date) %>%
mutate(total_pkgs = n()) %>%
group_by(artifact, date, tool, is_same_as_first_date, total_pkgs) %>%
summarize(total = n()) %>%
ggplot(aes(x = factor(date), y = 100 * total / total_pkgs, fill = is_same_as_first_date)) +
#ggplot(aes(x = factor(date), y = total, fill = is_same_as_first_date)) +
geom_col() +
#geom_text(data = .%>% filter(is_same_as_first_date), aes(y = 100*(total/total_pkgs) - 6, label = total), angle=0, size=2.0) +
#geom_text(data = .%>% filter(is_same_as_first_date), aes(y = 100*(total/total_pkgs) + 6, label = total_pkgs - total), angle=0, size=2.0) +
xlab("Dates of builds (YYYY-MM-DD)") +
ylab("Percentage of the packages") +
scale_fill_discrete("Are the versions of the packages the same as the initial build?", breaks = c(TRUE, FALSE), labels = c("Yes", "No")) +
facet_grid(tool~artifact, scales="free_y") +
theme_bw() +
theme(axis.text.x = element_text(angle = 45, hjust = 1), legend.position = "bottom")
```
```{r}
# xx %>%
# #left_join(first_date_versions) %>%
# #mutate(is_same_as_first_date = version == first_version) %>%
# #select(date, pkg, artifact, tool, is_same_as_first_date) %>%
# group_by(tool, date, rank) %>%
# mutate(total_pkgs = n()) %>%
# group_by(artifact, date, tool, is_same_as_first_date, total_pkgs) %>%
# summarize(total = n()) %>%
# ggplot(aes(x = factor(date), y = 100 * total / total_pkgs, fill = is_same_as_first_date)) +
# geom_col() +
# ylab("Percentage of the packages") +
# facet_wrap(~tool) +
# scale_fill_grey("Month when the package version was introduced in the environment", labels=rev(append(c("Initial"), seq(length(dates)-1))))+
# scale_x_discrete("Months after initial build", labels=append(c("Initial"), seq(length(dates)-1))) +
# theme_bw() +
# theme(legend.position = "bottom")
xx %>%
group_by(tool, date) %>%
mutate(total_pkgs = n()) %>%
group_by(tool, date, rank, total_pkgs) %>%
summarize(total = n()) %>%
mutate(rank = factor(rank)) %>%
mutate(rank = factor(rank, levels=rev(levels(rank)))) %>%
ggplot(aes(x = factor(date), y = 100 * total / total_pkgs, fill = rank)) +
geom_col() +
# geom_text(data = .%>% filter(is_same_as_first_date), aes(y = (100 * total/total_pkgs) - 1.5, label = paste(round(100*total/total_pkgs, digits=1), "%",sep="")), angle=0, size=1.6) +
#geom_hline(yintercept = 85, linetype="dashed") +
geom_text(data = . %>% filter(as.character(rank) == dates[1]), aes(y = (100 * total/total_pkgs) - 8, label = total), angle=0, size=2.5) +
geom_text(data = . %>% filter(as.character(rank) == dates[1]), aes(y = (100 * total/total_pkgs) - 24, label = paste("(",round(100*total/total_pkgs, digits = 1), "%)",sep="")), angle=0, size=2) +
#xlab("Dates of builds (YYYY-MM-DD)") +
ylab("Packages in environment [%]") +
facet_wrap(~tool, ncol = 2) +
ggtitle("Evolution of the packages versions through time") +
scale_fill_grey("Month when the package version was introduced in the environment", labels=rev(append(c("Initial"), seq(length(dates)-1))))+
scale_x_discrete("Months after initial build", labels=append(c("Initial"), seq(length(dates)-1))) +
#scale_fill_grey() +
theme_bw() +
theme(legend.position = "bottom", strip.background = element_blank())
#theme(axis.text.x = element_text(angle = 45, hjust = 1), legend.position = "bottom", strip.background = element_blank())
ggsave("rep24/fig2.pdf", width=5, height=3.5)
```
## Most volatile packages
```{r}
df %>%
group_by(pkg, artifact, tool) %>%
summarize(different_versions = n_distinct(version)) %>%
ungroup() %>%
slice_max(different_versions, n=10) %>%
knitr::kable()
df %>%
group_by(pkg, artifact, tool) %>%
summarize(different_versions = n_distinct(version)) %>%
ggplot(aes(x = different_versions, color = tool)) +
stat_ecdf() +
xlim(0, 6) +
theme_bw()
```
```{r}
pname = "linux-libc-dev:amd64"
libc_versions <- df %>%
filter(pkg == pname) %>%
pull(version) %>%
unique()
```
```{r}
df_libc <- read_delim("./ubuntu_linux-libc-dev_changelogs/all_versions.csv", delim=";;", col_names=c("version", "date")) %>%
mutate(date = as_date(date))
build_dates <- tibble(bdate = unique(df$date))
df_libc %>%
filter(date >= min(df$date) - months(6)) %>%
print() %>%
mutate(was_built = if_else(version %in% libc_versions, "built", "not built")) %>%
ggplot() +
geom_point(aes(x = date, y = 0, color = was_built)) +
geom_vline(data = build_dates, aes(xintercept = bdate), linetype = "dashed", color = "gray") +
theme_bw()
#libc_versions
unique(df_libc %>% filter(date >= min(df$date) - months(6)) %>% pull(version))
```
# Threats to validity
Very small sample, only Docker.
# Conclusion
`Dockerfile`s are not solutions to capture on the long term the software environment.
There is a trade-off between storing the Docker images built by the authors and their recipe.
Use Nix/Guix + Software Heritage.