Skip to content

Commit

Permalink
Merge pull request #580 from em-/style-spellcheck
Browse files Browse the repository at this point in the history
style(spellcheck): Run a spellchecker and fix typos
  • Loading branch information
utam0k authored Jan 4, 2022
2 parents 253196f + b00667a commit de6385f
Show file tree
Hide file tree
Showing 22 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/benchmark_execution_time.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ jobs:
# since the GITHUB_TOKEN is needed to let the bot commit messages in the PR
# but right now it is controlled by the organization.
# TODO: change back to use this when the permission granted
# - name: Writting report to PR comment
# - name: Writing report to PR comment
# uses: marocchino/sticky-pull-request-comment@v2
# with:
# append: true
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Here is why we are writing a new container runtime in Rust.
```console
$ hyperfine --prepare 'sudo sync; echo 3 | sudo tee /proc/sys/vm/drop_caches' --warmup 10 --min-runs 100 'sudo ./youki create -b tutorial a && sudo ./youki start a && sudo ./youki delete -f a'
```
- Enviroment
- Environment
```console
$ ./youki info
Version 0.0.1
Expand Down
2 changes: 1 addition & 1 deletion crates/integration_test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ This framework also has some test utils, meant to help doing common operations i
- delete_container : runs the runtime command with delete argument, with given id and with given bundle directory
- get_state : runs the runtime command with state argument, with given id and with given bundle directory
- test_outside_container : this is meant to mimic [validateOutsideContainer](https://github.com/opencontainers/runtime-tools/blob/59cdde06764be8d761db120664020f0415f36045/validation/util/test.go#L263) function of original tests.
- check_container_created: this checks if the container was created succesfully.
- check_container_created: this checks if the container was created successfully.
- test_result!: this is a macro, that allows you to convert from a Result<T,E> to a TestResult

Note that even though all of the above functions are provided, most of the time the only required function is test_outside_container, as it does all the work of setting up the bundle, creating and running the container, getting the state of the container, killing the container and then deleting the container.
Expand Down
2 changes: 1 addition & 1 deletion crates/integration_test/src/utils/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ pub fn check_container_created(data: &ContainerData) -> Result<()> {
Ok(exit_status) => {
if !exit_status.success() {
bail!(
"container creation was not successfull. Exit code was {:?}",
"container creation was not successful. Exit code was {:?}",
exit_status.code()
)
}
Expand Down
2 changes: 1 addition & 1 deletion crates/libcgroups/src/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ pub struct PidStats {
/// Reports block io stats for a cgroup
#[derive(Debug, Default, PartialEq, Eq, Serialize)]
pub struct BlkioStats {
// Number of bytes transfered to/from a device by the cgroup
// Number of bytes transferred to/from a device by the cgroup
pub service_bytes: Vec<BlkioDeviceStat>,
// Number of I/O operations performed on a device by the cgroup
pub serviced: Vec<BlkioDeviceStat>,
Expand Down
2 changes: 1 addition & 1 deletion crates/libcgroups/src/systemd/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ impl Memory {
// as memory limit would be either bigger (invariant violation) or zero which would
// leave the container with no memory and no swap.
// if swap is greater than zero and memory limit is unspecified swap cannot be
// calulated. If memory limit is zero the container would have only swap. If
// calculated. If memory limit is zero the container would have only swap. If
// memory is unlimited it would be bigger than swap.
(_, Some(0)) | (None | Some(0) | Some(-1), Some(1..=i64::MAX)) => bail!(
"cgroup v2 swap value cannot be calculated from swap of {} and limit of {}",
Expand Down
4 changes: 2 additions & 2 deletions crates/libcgroups/src/v1/blkio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const BLKIO_THROTTLE_WRITE_IOPS: &str = "blkio.throttle.write_iops_device";
// Number of I/O operations performed on a device by the cgroup
// Format: Major:Minor Type Ops
const BLKIO_THROTTLE_IO_SERVICED: &str = "blkio.throttle.io_serviced";
// Number of bytes transfered to/from a device by the cgroup
// Number of bytes transferred to/from a device by the cgroup
// Format: Major:Minor Type Bytes
const BLKIO_THROTTLE_IO_SERVICE_BYTES: &str = "blkio.throttle.io_service_bytes";

Expand Down Expand Up @@ -54,7 +54,7 @@ const BLKIO_TIME: &str = "blkio.time_recursive";
// Number of sectors transferred to/from a device by the cgroup
// Format: Major:Minor Sectors
const BLKIO_SECTORS: &str = "blkio.sectors_recursive";
// Number of bytes transfered to/from a device by the cgroup
// Number of bytes transferred to/from a device by the cgroup
/// Format: Major:Minor Type Bytes
const BLKIO_IO_SERVICE_BYTES: &str = "blkio.io_service_bytes_recursive";
// Number of I/O operations performed on a device by the cgroup
Expand Down
2 changes: 1 addition & 1 deletion crates/libcgroups/src/v1/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ impl Manager {
if let Some(subsystem_path) = self.subsystems.get(controller) {
required_controllers.insert(controller, subsystem_path);
} else {
bail!("cgroup {} is required to fullfill the request, but is not supported by this system", controller);
bail!("cgroup {} is required to fulfill the request, but is not supported by this system", controller);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/libcgroups/src/v2/devices/emulator.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use anyhow::Result;
use oci_spec::runtime::{LinuxDeviceCgroup, LinuxDeviceType};

// For cgroup v1 compatiblity, runc implements a device emulator to caculate the final rules given
// For cgroup v1 compatibility, runc implements a device emulator to caculate the final rules given
// a list of user-defined rules.
// https://github.com/opencontainers/runc/commit/2353ffec2bb670a200009dc7a54a56b93145f141
//
Expand Down
4 changes: 2 additions & 2 deletions crates/libcontainer/src/capabilities.rs
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ mod tests {
struct Testcase {
name: String,
input: LinuxCapabilities,
// be awared of that calling sequence in the drop_privileges function
// be aware that the calling sequence in the drop_privileges function
// will affect the output sequence from test_command.get_set_capability_args()
want: Vec<(CapSet, Vec<SpecCapability>)>,
}
Expand Down Expand Up @@ -639,7 +639,7 @@ mod tests {

for (i, want) in test.want.iter().enumerate().take(test.want.len()) {
// because CapSet has no Eq, PartialEq attributes,
// so using String to do the comparsion.
// so using String to do the comparison.
let want_cap_set = format!("{:?}", want.0);
let got_cap_set = format!("{:?}", got[i].0);
let want_caps = &want.1;
Expand Down
4 changes: 2 additions & 2 deletions crates/libcontainer/src/hooks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::{
};

use crate::{container::Container, utils};
// A special error used to signal a timeout. We want to differenciate between a
// A special error used to signal a timeout. We want to differentiate between a
// timeout vs. other error.
#[derive(Debug)]
pub struct HookTimeoutError;
Expand All @@ -28,7 +28,7 @@ pub fn run_hooks(hooks: Option<&Vec<Hook>>, container: Option<&Container>) -> Re
if let Some(hooks) = hooks {
for hook in hooks {
let mut hook_command = process::Command::new(&hook.path());
// Based on OCI spec, the first arguement of the args vector is the
// Based on OCI spec, the first argument of the args vector is the
// arg0, which can be different from the path. For example, path
// may be "/usr/bin/true" and arg0 is set to "true". However, rust
// command differenciates arg0 from args, where rust command arg
Expand Down
4 changes: 2 additions & 2 deletions crates/libcontainer/src/process/container_init_process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ fn get_open_fds() -> Result<Vec<i32>> {
// stay open: stdio, stdout, and stderr. We would further preserve the next
// "preserve_fds" number of fds. Set the rest of fd with CLOEXEC flag, so they
// will be closed after execve into the container payload. We can't close the
// fds immediatly since we at least still need it for the pipe used to wait on
// fds immediately since we at least still need it for the pipe used to wait on
// starting the container.
fn cleanup_file_descriptors(preserve_fds: i32) -> Result<()> {
let open_fds = get_open_fds().with_context(|| "Failed to obtain opened fds")?;
Expand Down Expand Up @@ -366,7 +366,7 @@ pub fn container_init_process(
}
};

// Clean up and handle perserved fds. We only mark the fd as CLOSEXEC, so we
// Clean up and handle preserved fds. We only mark the fd as CLOSEXEC, so we
// don't have to worry about when the fd will be closed.
cleanup_file_descriptors(preserve_fds).with_context(|| "Failed to clean up extra fds")?;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub fn container_intermediate_process(
// process, We want to make sure continue as the root user inside the
// new user namespace. This is required because the process of
// configuring the container process will require root, even though the
// root in the user namespace likely is mapped to an non-priviliged user
// root in the user namespace likely is mapped to an non-privileged user
// on the parent user namespace.
command.set_id(Uid::from_raw(0), Gid::from_raw(0)).context(
"failed to configure uid and gid root in the beginning of a new user namespace",
Expand Down
2 changes: 1 addition & 1 deletion crates/libcontainer/src/rootless.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ impl<'a> Rootless<'a> {
let user_namespace = namespaces.get(LinuxNamespaceType::User);

// If conditions requires us to use rootless, we must either create a new
// user namespace or enter an exsiting.
// user namespace or enter an existing.
if rootless_required() && user_namespace.is_none() {
bail!("rootless container requires valid user namespace definition");
}
Expand Down
4 changes: 2 additions & 2 deletions crates/libcontainer/src/seccomp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use std::os::unix::io;

#[derive(Debug)]
struct Compare {
// The zero-indexed index of the syscall arguement.
// The zero-indexed index of the syscall argument.
arg: libc::c_uint,
op: Option<scmp_compare>,
datum_a: Option<scmp_datum_t>,
Expand Down Expand Up @@ -299,7 +299,7 @@ pub fn initialize_seccomp(seccomp: &LinuxSeccomp) -> Result<Option<io::RawFd>> {
for syscall in syscalls {
let action = translate_action(syscall.action(), syscall.errno_ret());
if action == default_action {
// When the action is the same as the default action, the rule is redundent. We can
// When the action is the same as the default action, the rule is redundant. We can
// skip this here to avoid failing when we add the rules.
log::warn!(
"Detect a seccomp action that is the same as the default action: {:?}",
Expand Down
2 changes: 1 addition & 1 deletion crates/liboci-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This is a crate to parse command line arguments for OCI container
runtimes as specified in the [OCI Runtime Command Line
Interface][https://github.com/opencontainers/runtime-tools/blob/master/docs/command-line-interface.md).
Interface](https://github.com/opencontainers/runtime-tools/blob/master/docs/command-line-interface.md).

## Implemented subcommands

Expand Down
2 changes: 1 addition & 1 deletion docs/src/developer/libcgroups.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This crates exposes several functions and modules that can be used to work with
- common traits and functions which are used by both v1 and v2 such as

- Trait CgroupManager, this abstracts over the underlying implementation of interacting with specific version of cgroups, and gives functions to add certain process to a certain cgroup, apply resource restrictions, get statistics of a cgroups, freeze a cgroup, remove a cgroup or get list of all processes belonging to a cgroup. v1 and v2 modules both contain a version specific cgroup manager which implements this trait, and thus either can be given to functions or structs which expects a cgroup manager, depending on which cgroups the host system uses.
- Apart from the trait, this also contians functions which help with reading cgroups files, and write data to a cgroup file, which are used throughout this crate.
- Apart from the trait, this also contains functions which help with reading cgroups files, and write data to a cgroup file, which are used throughout this crate.
- A function to detect which cgroup setup (v1, v2 or hybrid) is on the host system, as well as a function to get the corresponding cgroups manager.

- Functions and structs to get and store the statistics of a cgroups such as
Expand Down
2 changes: 1 addition & 1 deletion docs/src/developer/libcontainer.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This crate also provides an interface for Apparmor which is another Linux Kernel

- rootfs, which is a ramfs like simple filesystem used by kernel during initialization
- hooks, which allow running of specified program at certain points in the container lifecycle, such as before and after creation, start etc.
- singals, which provide a wrapper to convert to and from signal numbers and text representation of signal names
- signals, which provide a wrapper to convert to and from signal numbers and text representation of signal names
- capabilities, which has functions related to set and reset specific capabilities, as well as to drop extra privileges
- [Simple explanation of capabilities](https://blog.container-solutions.com/linux-capabilities-in-practice)
- [man page for capabilities](https://man7.org/linux/man-pages/man7/capabilities.7.html)
Expand Down
2 changes: 1 addition & 1 deletion docs/src/developer/youki.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# youki

This is the core crate that contains the youki binary itself. This provides the user interface, as well as binds the ther crates together to actually perform the work of creation and management of containers. THus this provides implementation of all the commands supported by youki.
This is the core crate that contains the youki binary itself. This provides the user interface, as well as binds the other crates together to actually perform the work of creation and management of containers. THus this provides implementation of all the commands supported by youki.

The simple control flow of youki can be explained as :

Expand Down
2 changes: 1 addition & 1 deletion docs/src/user/basic_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This explains the requirements for compiling Youki as a binary, to use it as a low-level container runtime, or to depend once of its crates as dependency for your own project.

Youki currently only supports Linux Platfrom, and to use it on other platform you will need to use some kind of virtualization. The repo itself provides Vagrantfile that provides basic setup to use Youki on non-Linux system using Vagrant. The last sub-section explains using this vagrantfile.
Youki currently only supports Linux Platform, and to use it on other platform you will need to use some kind of virtualization. The repo itself provides Vagrantfile that provides basic setup to use Youki on non-Linux system using Vagrant. The last sub-section explains using this vagrantfile.

Also note that Youki currently only supports and expects systemd as init system, and would not work on other systems. There is currently work on-going to put systemd dependent features behind a feature flag, but till then you will need a systemd enabled system to work with Youki.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/youki.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Here is why we are writing a new container runtime in Rust.
```console
$ hyperfine --prepare 'sudo sync; echo 3 | sudo tee /proc/sys/vm/drop_caches' --warmup 10 --min-runs 100 'sudo ./youki create -b tutorial a && sudo ./youki start a && sudo ./youki delete -f a'
```
- Enviroment
- Environment
`console $ ./youki info Version 0.0.1 Kernel-Release 5.11.0-41-generic Kernel-Version #45-Ubuntu SMP Fri Nov 5 11:37:01 UTC 2021 Architecture x86_64 Operating System Ubuntu 21.04 Cores 12 Total Memory 32025 Cgroup setup hybrid Cgroup mounts blkio /sys/fs/cgroup/blkio cpu /sys/fs/cgroup/cpu,cpuacct cpuacct /sys/fs/cgroup/cpu,cpuacct cpuset /sys/fs/cgroup/cpuset devices /sys/fs/cgroup/devices freezer /sys/fs/cgroup/freezer hugetlb /sys/fs/cgroup/hugetlb memory /sys/fs/cgroup/memory net_cls /sys/fs/cgroup/net_cls,net_prio net_prio /sys/fs/cgroup/net_cls,net_prio perf_event /sys/fs/cgroup/perf_event pids /sys/fs/cgroup/pids unified /sys/fs/cgroup/unified CGroup v2 controllers cpu detached cpuset detached hugetlb detached io detached memory detached pids detached device attached Namespaces enabled mount enabled uts enabled ipc enabled user enabled pid enabled network enabled cgroup enabled $ ./youki --version youki version 0.0.1 commit: 0.0.1-0-0be33bf $ runc -v runc version 1.0.0-rc93 commit: 12644e614e25b05da6fd08a38ffa0cfe1903fdec spec: 1.0.2-dev go: go1.13.15 libseccomp: 2.5.1 $ crun --version crun version 0.19.1.45-4cc7 commit: 4cc7fa1124cce75dc26e12186d9cbeabded2b710 spec: 1.0.0 +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL `
</details>

Expand Down
8 changes: 4 additions & 4 deletions integration_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ test_cases=(
"linux_ns_nopath/linux_ns_nopath.t"
"linux_ns_path/linux_ns_path.t"
"linux_ns_path_type/linux_ns_path_type.t"
# This test case requires that an apparmor profile named 'acme_secure_profile' has been installed on the system. It needs to allow the capabilites
# This test case requires that an apparmor profile named 'acme_secure_profile' has been installed on the system. It needs to allow the capabilities
# validated by runtime-tools otherwise the test case will fail despite the profile being available.
# "linux_process_apparmor_profile/linux_process_apparmor_profile.t"
"linux_readonly_paths/linux_readonly_paths.t"
Expand Down Expand Up @@ -76,7 +76,7 @@ test_cases=(
"state/state.t"
)

check_enviroment() {
check_environment() {
test_case=$1
if [[ $test_case =~ .*(memory|hugetlb).t ]]; then
if [[ ! -e "/sys/fs/cgroup/memory/memory.memsw.limit_in_bytes" ]]; then
Expand All @@ -94,8 +94,8 @@ done


for case in "${test_cases[@]}"; do
if ! check_enviroment $case; then
echo "Skip $case bacause your enviroment doesn't support this test case"
if ! check_environment $case; then
echo "Skip $case bacause your environment doesn't support this test case"
continue
fi

Expand Down

0 comments on commit de6385f

Please sign in to comment.