Skip to content

Commit

Permalink
Added initial Dockerfile to create doppelganger image; ported in "scu…
Browse files Browse the repository at this point in the history
…rler" code from a previous demo project.
  • Loading branch information
ndenny committed Oct 7, 2024
1 parent bff10f2 commit 21772c3
Show file tree
Hide file tree
Showing 4 changed files with 428 additions and 0 deletions.
48 changes: 48 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
FROM ubuntu:22.04

#-- Set the specific version of bastion to install.
ENV BASTION bastion-q24A034X

RUN apt update && apt upgrade -y

RUN mkdir /SCRATCH && \
mkdir /DATA && \
mkdir /LOG && \
mkdir /BFD && \
mkdir /CONF && \
mkdir /root/.private && \
mkdir /root/.bastion && \
mkdir /root/.ssh && \
mkdir /etc/bastion

#-- Install the RCAC supplied hsi package
#-- Note, that the RCAC .deb package has an undeclared dependency on libedit2
RUN apt install -y libedit2
COPY hsi-htar-9.3.0-rcac1-amd64.deb .
RUN dpkg --install hsi-htar-9.3.0-rcac1-amd64.deb
RUN rm hsi-htar-9.3.0-rcac1-amd64.deb

#-- Python dependencies for bastion
RUN apt install -y \
python3 \
python3-yaml \
python3-ruamel.yaml \
python-is-python3

#-- Install bastion from local tar file.
WORKDIR /opt
COPY ${BASTION}.tar .
RUN tar xvf ${BASTION}.tar
RUN ln -s /opt/${BASTION} /opt/bastion
RUN rm ${BASTION}.tar

WORKDIR /
COPY CONF/conf-000-dockerized.yaml /etc/bastion
COPY CONF/ssh_config /root/.ssh/config

#-- Useful stuff for debugging, but can probably be taken out of distribution.
RUN apt install -y \
nano \
git


19 changes: 19 additions & 0 deletions lab/fortress_example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import pathlib

from Bastion.Movers.sCURL import SCURLer

USER = 'ndenny'
KEYPATH = pathlib.Path("~/.ssh/bastion_bot").expanduser()

LOCAL = pathlib.Path("/mnt/BFD/bastion/bank")
REMOTE = pathlib.Path("/home/{}/bastion".format(USER))

SITE = "rusina"
ZONE = "soundscapes"
ASSET = "HackathonData"
BLONDE = "3AQXEGFS024A03CMFZMT.tar"

fortress = SCURLer(USER, 'sftp.fortress.rcac.purdue.edu', keyfile = KEYPATH, silent = False, verbose = True)
home = fortress['/home/{}'.format(USER)]
bastion = fortress['/home/{}/bastion'.format(USER)]

5 changes: 5 additions & 0 deletions lib/Bastion/Movers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""
Bastion.Movers
I am the collection of codes for the transfer ("mover") agents
"""
Loading

0 comments on commit 21772c3

Please sign in to comment.