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

Dockerfiles for xc7 and eos #220

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
build
env
__pycache__
arch-definitions
21 changes: 21 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
services:
xc7:
container_name: symbiflow-xc7
image: symbiflow-xc7
build:
context: .
dockerfile: xc7/Dockerfile
volumes:
- ./common:/symbiflow-examples/common
- ./xc7:/symbiflow-examples/xc7
- ./arch-definitions/xc7:/root/opt/symbiflow/xc7/install
eos-s3:
container_name: symbiflow-eos-s3
image: symbiflow-eos-s3
build:
context: .
dockerfile: eos-s3/Dockerfile
volumes:
- ./common:/symbiflow-examples/common
- ./eos-s3:/symbiflow-examples/eos-s3
- ./arch-definitions/eos-s3:/root/opt/symbiflow/eos-s3/install
26 changes: 26 additions & 0 deletions eos-s3/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM ubuntu:18.04

ARG INSTALL_DIR=/root/opt/symbiflow
ARG FPGA_FAM=eos-s3

ENV PATH="$PATH:/root/miniconda3/bin"
ENV PATH="$PATH:$INSTALL_DIR/$FPGA_FAM/install/bin"

RUN apt-get update && apt-get install -y git wget xz-utils make

RUN wget \
https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \
&& mkdir /root/.conda \
&& bash Miniconda3-latest-Linux-x86_64.sh -b \
&& rm -f Miniconda3-latest-Linux-x86_64.sh

RUN mkdir -p $INSTALL_DIR

COPY $FPGA_FAM/environment.yml $FPGA_FAM/requirements.txt /$INSTALL_DIR/
RUN conda env create -f $INSTALL_DIR/environment.yml

COPY $FPGA_FAM/entrypoint.sh ./entrypoint.sh
RUN chmod +x ./entrypoint.sh
ENTRYPOINT ["./entrypoint.sh"]


7 changes: 7 additions & 0 deletions eos-s3/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

# activate the environment
source activate eos-s3

# exec the cmd/command in this process, making it pid 1
exec "$@"
34 changes: 34 additions & 0 deletions scripts/docker/console
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash

set -e

while [[ "$#" > 0 ]]; do case $1 in
--xc7)
XC7=1
shift
;;
--eos)
EOS=1
shift
;;
*)
echo -n "Unknown parameter passed: $1"
shift
shift
;;
esac done

if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
if [[ "${XC7}" ]]; then
docker-compose \
-f docker-compose.yml \
run --rm \
xc7 /bin/bash

exit 0

fi
if [[ "${EOS}" ]]; then
:
fi
fi
58 changes: 58 additions & 0 deletions scripts/docker/download
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/bash

set -e

arch="arch-definitions"

# Parse args
while [[ "$#" > 0 ]]; do case $1 in
--xc7)
XC7=1
shift
;;
--eos-s3)
EOS=1
shift
;;
*)
echo -n "Unknown parameter passed: $1"
shift
shift
;;
esac done


if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
if [[ "${XC7}" ]]; then

xc7_arch="../../$arch/xc7"

parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
cd "$parent_path" && mkdir -p $xc7_arch

declare -a arr=("https://storage.googleapis.com/symbiflow-arch-defs/artifacts/prod/foss-fpga-tools/symbiflow-arch-defs/continuous/install/367/20210822-000315/symbiflow-arch-defs-install-709cac78.tar.xz"
"https://storage.googleapis.com/symbiflow-arch-defs/artifacts/prod/foss-fpga-tools/symbiflow-arch-defs/continuous/install/367/20210822-000315/symbiflow-arch-defs-xc7a50t_test-709cac78.tar.xz"
"https://storage.googleapis.com/symbiflow-arch-defs/artifacts/prod/foss-fpga-tools/symbiflow-arch-defs/continuous/install/367/20210822-000315/symbiflow-arch-defs-xc7a100t_test-709cac78.tar.xz"
"https://storage.googleapis.com/symbiflow-arch-defs/artifacts/prod/foss-fpga-tools/symbiflow-arch-defs/continuous/install/367/20210822-000315/symbiflow-arch-defs-xc7a200t_test-709cac78.tar.xz"
"https://storage.googleapis.com/symbiflow-arch-defs/artifacts/prod/foss-fpga-tools/symbiflow-arch-defs/continuous/install/367/20210822-000315/symbiflow-arch-defs-xc7z010_test-709cac78.tar.xz"
)

echo "Downloading xc7 architecture definitions..."
for i in "${arr[@]}"
do
wget -qO- $i | tar -xJC $xc7_arch
echo "Downloading $i"
done
fi
if [[ "${EOS}" ]]; then
echo "Downloading EOS-S3 architecture definitions..."

eos_arch="../../$arch/eos-s3"

parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
cd "$parent_path" && mkdir -p $eos_arch

wget -qO- https://storage.googleapis.com/symbiflow-arch-defs-install/quicklogic-arch-defs-63c3d8f9.tar.gz | tar -xz -C $eos_arch

fi
fi
13 changes: 13 additions & 0 deletions scripts/docker/setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

set -e

if [ "${BASH_SOURCE[0]}" = "${0}" ]; then

# Download arch definitions
# scripts/download

# Build docker containers
scripts/update

fi
28 changes: 28 additions & 0 deletions scripts/docker/update
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

# Builds the docker containers.

set -e

NO_CACHE="";
while [[ "$#" > 0 ]]; do case $1 in
--no-cache) NO_CACHE="--no-cache"; shift;;
--restart) RESTART_SERVERS=1; shift;;
*) usage "Unknown parameter passed: $1"; shift; shift;;
esac; done

if [ "${BASH_SOURCE[0]}" = "${0}" ]; then

if [ "${RESTART_SERVERS}" ]; then
echo "==Bringing down servers.."
docker-compose \
-f docker-compose.yml \
down --remove-orphans
fi

echo "==Building images..."
docker-compose \
-f docker-compose.yml \
build ${NO_CACHE}

fi
27 changes: 27 additions & 0 deletions xc7/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM ubuntu:18.04


ARG INSTALL_DIR=/root/opt/symbiflow
ARG FPGA_FAM=xc7

ENV PATH="$PATH:/root/miniconda3/bin"
ENV PATH="$PATH:$INSTALL_DIR/$FPGA_FAM/install/bin"

RUN apt-get update && apt-get install -y git wget xz-utils make

RUN wget \
https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \
&& mkdir /root/.conda \
&& bash Miniconda3-latest-Linux-x86_64.sh -b \
&& rm -f Miniconda3-latest-Linux-x86_64.sh

RUN mkdir -p $INSTALL_DIR

COPY $FPGA_FAM/environment.yml $FPGA_FAM/requirements.txt /$INSTALL_DIR/
RUN conda env create -f $INSTALL_DIR/environment.yml

COPY $FPGA_FAM/entrypoint.sh ./entrypoint.sh
RUN chmod +x ./entrypoint.sh
ENTRYPOINT ["./entrypoint.sh"]


7 changes: 7 additions & 0 deletions xc7/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

# activate the environment
source activate xc7

# exec the cmd/command in this process, making it pid 1
exec "$@"