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

[native] Setup-centos.sh simplification and defragmentation. #19064

Closed
wants to merge 2 commits into from

Conversation

Mionsz
Copy link
Contributor

@Mionsz Mionsz commented Feb 15, 2023

Setup-centos.sh script simplification and defragmentation.

From functional point of view nothing changes at all, but from practical point of view:

Using default value notation VARIABLE=${VARIABLE:-DEFAULT} instead of overwrite variable VARIABLE=$DEFAULT all bellow parameters can be easily overwritten by developer but if nothing is done the right-side default value is sed:

export FB_OS_VERSION="${FB_OS_VERSION:-'v2022.11.14.00'}"
export nproc="${nproc:-"$(getconf _NPROCESSORS_ONLN)"}"
export CC="${CC:-/opt/rh/gcc-toolset-9/root/bin/gcc}"
export CXX="${CXX:-/opt/rh/gcc-toolset-9/root/bin/g++}"
export CPU_TARGET="${CPU_TARGET:-avx}"
export COMPILER_FLAGS="${COMPILER_FLAGS:-"$(echo -n $(get_cxx_flags $CPU_TARGET))"}"

This should be preferred in generic repositories as single change in workflow not always require any changes in the point of interest scripts as they are flexible.

Added git, wget and tar as those may not be yet installed inside the container as we are planning to change the Docker workflow

This is a connected issue as PR makes the automation scripts more flexible:
#19066

This PR optimizes:
#19211

== NO RELEASE NOTE ==

setup-centos.sh variables adjustment to make them not override is user have already set compiler values.
@Mionsz Mionsz requested a review from a team as a code owner February 15, 2023 22:57
@Mionsz
Copy link
Contributor Author

Mionsz commented Feb 15, 2023

This also need to be tested by sb other than me on my developer machine.

`Setup-centos.sh` script simplification and defragmentation.

From functional point of view nothing changes at all, but from practical point of view:

Using default value notation `VARIABLE=${VARIABLE:-DEFAULT}` instead of overwrite variable `VARIABLE=$DEFAULT` all bellow parameters can be easily overwritten by developer but if nothing is done the right-side default value is sed:

```bash
export FB_OS_VERSION="${FB_OS_VERSION:-'v2022.11.14.00'}"
export nproc="${nproc:-"$(getconf _NPROCESSORS_ONLN)"}"
export CC="${CC:-/opt/rh/gcc-toolset-9/root/bin/gcc}"
export CXX="${CXX:-/opt/rh/gcc-toolset-9/root/bin/g++}"
export CPU_TARGET="${CPU_TARGET:-avx}"
export COMPILER_FLAGS="${COMPILER_FLAGS:-"$(echo -n $(get_cxx_flags $CPU_TARGET))"}"
```
This should be preferred in generic repositories as single change in workflow not always require any changes in the point of interest scripts as they are flexible.

Added `git`, `wget` and `tar` as those may not be yet installed inside the container as we are planning to change the Docker workflow

```
== NO RELEASE NOTE ==
```
@Mionsz Mionsz changed the title [native] setup-centos.sh variables adjustment [native] Setup-centos.sh simplification and defragmentation. Apr 5, 2023
@Mionsz Mionsz closed this Apr 6, 2023
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.

1 participant