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

Unify options for installing dependencies #2606

Merged
merged 8 commits into from
Dec 27, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/github-actions-test-installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ on:
paths:
- 'etc/DependencyInstaller.sh'
- 'docker/*'
- '.github/workflows/github-actions-test-installer.yml'
pull_request:
paths:
- 'etc/DependencyInstaller.sh'
- 'docker/*'
- '.github/workflows/github-actions-test-installer.yml'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,14 @@ transceivers, OpenPower-based Microwatt etc.

For a limited number of configurations, the following script can be used
to install dependencies. The script `etc/DependencyInstaller.sh` supports
Centos7 and Ubuntu 20.04. To correctly install the dependencies with the
Centos7, Ubuntu 20.04, Ubuntu 22.04, RHEL 8, Debian 10 and Debian 11. To correctly install the dependencies with the
script you need to run as root or prepend `sudo` to the commands below.

``` shell
./etc/DependencyInstaller.sh -help

Usage: ./etc/DependencyInstaller.sh -run[time] # installs dependencies to run a pre-compiled binary
./etc/DependencyInstaller.sh -dev[elopment] # installs dependencies to compile the openroad binary
Usage: ./etc/DependencyInstaller.sh -prefix=DIR # installs dependencies in an existing user specified directory
./etc/DependencyInstaller.sh -local # installs dependencies in "$HOME/.local"

```

Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.binary
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

# https://github.com/moby/moby/issues/38379#issuecomment-448445652
ARG copyImage=openroad/centos7-builder:latest
ARG fromImage=openroad/centos7-runtime:latest
ARG fromImage=openroad/centos7-dev:latest

# need to use the line below as the "COPY --from" does not accept an ARG
FROM $copyImage AS copyfrom
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ ARG INSTALLER_ARGS=""

COPY DependencyInstaller.sh /tmp/.

RUN /tmp/DependencyInstaller.sh -dev $INSTALLER_ARGS && rm -f /tmp/DependencyInstaller.sh
RUN /tmp/DependencyInstaller.sh $INSTALLER_ARGS && rm -f /tmp/DependencyInstaller.sh
11 changes: 0 additions & 11 deletions docker/Dockerfile.runtime

This file was deleted.

2 changes: 1 addition & 1 deletion docs/user/BuildLocally.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ During initial setup or if you have a new machine, run this script:

``` shell
# either run as root or use sudo
./etc/DependencyInstaller.sh -dev
./etc/DependencyInstaller.sh
```

### KLayout
Expand Down
35 changes: 12 additions & 23 deletions etc/DependencyInstaller.sh
Original file line number Diff line number Diff line change
Expand Up @@ -414,17 +414,14 @@ _installDebianRuntime() {
_help() {
cat <<EOF

Usage: $0 -run[time]
$0 -dev[elopment]
$0 -prefix=DIR
Usage: $0 -prefix=DIR
$0 -local

EOF
exit "${1:-1}"
}

# default option
option="runtime"
#default prefix
PREFIX=""

# default values, can be overwritten by cmdline args
Expand All @@ -434,10 +431,10 @@ while [ "$#" -gt 0 ]; do
_help 0
;;
-run|-runtime)
option="runtime"
echo "The use of this flag is deprecated and will be removed soon"
;;
-dev|-development)
option="dev"
echo "The use of this flag is deprecated and will be removed soon"
;;
-local)
export PREFIX="$HOME/.local"
Expand Down Expand Up @@ -477,10 +474,8 @@ case "${os}" in
spdlogFolder="/usr/local/lib64/cmake/spdlog/spdlogConfigVersion.cmake"
export spdlogFolder
_installCentosRuntime
if [[ "${option}" == "dev" ]]; then
_installCentosDev
_installCommonDev
fi
_installCentosDev
_installCommonDev
_installOrTools "centos" "7" "amd64"
_installCentosCleanUp
cat <<EOF
Expand All @@ -494,21 +489,17 @@ EOF
spdlogFolder="/usr/local/lib/cmake/spdlog/spdlogConfigVersion.cmake"
export spdlogFolder
_installUbuntuRuntime "${version}"
if [[ "${option}" == "dev" ]]; then
_installUbuntuDev
_installCommonDev
fi
_installUbuntuDev
_installCommonDev
_installOrTools "ubuntu" "${version}" "amd64"
_installUbuntuCleanUp
;;
"Red Hat Enterprise Linux")
spdlogFolder="/usr/local/lib64/cmake/spdlog/spdlogConfigVersion.cmake"
export spdlogFolder
_installRHELRuntime
if [[ "${option}" == "dev" ]]; then
_installRHELDev
_installCommonDev
fi
_installRHELDev
Copy link
Member

Choose a reason for hiding this comment

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

The goal of this PR should also include replacing both_install*Runtime and _install*Dev with a single function. Bonus if we can remove any unnecessary packages.

_installCommonDev
_installOrTools "centos" "8" "amd64"
_installRHELCleanUp
;;
Expand All @@ -528,10 +519,8 @@ EOF
spdlogFolder="/usr/local/lib/cmake/spdlog/spdlogConfigVersion.cmake"
export spdlogFolder
_installDebianRuntime "${version}"
if [[ "${option}" == "dev" ]]; then
_installDebianDev
_installCommonDev
fi
_installDebianDev
_installCommonDev
_installOrTools "debian" "${version}" "amd64"
_installDebianCleanUp
;;
Expand Down
9 changes: 1 addition & 8 deletions etc/DockerHelper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ usage: $0 [CMD] [OPTIONS]
'dev': os + packages to compile app
'builder': os + packages to compile app +
copy source code and build app
'runtime': os + packages to run a compiled app
'binary': os + packages to run a compiled
app + binary set as entrypoint
-threads Max number of threads to use if compiling.
Expand Down Expand Up @@ -99,14 +98,8 @@ _setup() {
buildArgs=""
fi
;;
"runtime" )
fromImage="${FROM_IMAGE_OVERRIDE:-$osBaseImage}"
context="etc"
copyImage="${COPY_IMAGE_OVERRIDE:-"${org}/${os}-builder-${compiler}"}:${imageTag}"
buildArgs="--build-arg copyImage=${copyImage}"
;;
"binary" )
fromImage="${FROM_IMAGE_OVERRIDE:-${org}/${os}-runtime}:${imageTag}"
fromImage="${FROM_IMAGE_OVERRIDE:-${org}/${os}-dev}:${imageTag}"
context="etc"
copyImage="${COPY_IMAGE_OVERRIDE:-"${org}/${os}-builder-${compiler}"}:${imageTag}"
buildArgs="--build-arg copyImage=${copyImage}"
Expand Down