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

Remove pwsh #1752

Merged
merged 30 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
515f235
Remove deployment
JimMadge Mar 1, 2024
655170b
Remove environment configs
JimMadge Mar 1, 2024
0cbad8f
Remove tests
JimMadge Mar 1, 2024
f3737b0
Move tests directory
JimMadge Mar 1, 2024
bd72ebc
Remove devcontainer directory
JimMadge Mar 1, 2024
2070054
Remove deployment chapter
JimMadge Mar 1, 2024
44c242b
Remove architecture subchapter
JimMadge Mar 1, 2024
6c63384
Remove system manager subchapter
JimMadge Mar 1, 2024
d6258a2
Remove pwsh formatting note from PR template
JimMadge Mar 1, 2024
0101e84
Update issue templates
JimMadge Mar 1, 2024
8e516ac
Remove software approval process
JimMadge Mar 1, 2024
bff490c
Remove reference to deployment
JimMadge Mar 1, 2024
13a0a03
Remove reference to design sre
JimMadge Mar 1, 2024
abbc338
Remove reference to architecture
JimMadge Mar 1, 2024
1e4349f
Bump cryptography from 41.0.7 to 42.0.4
dependabot[bot] Apr 8, 2024
830b2d4
Merge pull request #1774 from alan-turing-institute/dependabot/pip/cr…
JimMadge Apr 8, 2024
d3e86bf
:bug: Fix bug in Docker image update script
jemrobinson Apr 8, 2024
542d237
:wrench: Update Docker image update action to run on develop
jemrobinson Apr 8, 2024
1977b03
:bug: Fix crontab entry
jemrobinson Apr 9, 2024
319ee5f
Don't run workflow on pushes
JimMadge Apr 9, 2024
6d9c6c5
Merge pull request #1775 from alan-turing-institute/fix-docker-versio…
jemrobinson Apr 9, 2024
e9611b5
Remove pwsh
JimMadge Apr 9, 2024
a337389
Restore system manager index page
JimMadge Apr 9, 2024
028e5ee
Restore lines cut from index
JimMadge Apr 9, 2024
0415673
Remove non-existent reference
JimMadge Apr 9, 2024
8b978ab
Remove reference to deployment section
JimMadge Apr 9, 2024
458e590
Restore ToC item for system manager
JimMadge Apr 9, 2024
86f55ba
Remove references to non-existent pages
JimMadge Apr 9, 2024
f6f42ce
Add empty deployment and system manager pages
JimMadge Apr 9, 2024
ca9572b
Add devcontainer files
JimMadge Apr 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
64 changes: 18 additions & 46 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,50 +1,26 @@
ARG VARIANT=3.10
FROM python:${VARIANT}-buster

RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends apt-transport-https \
ca-certificates \
curl \
git \
gnupg \
libssl-dev \
lsb-release \
python3-sphinx \
sudo

# Set package versions
ARG AZURE_CLI_VERSION="2.58.0"
ARG PWSH_VERSION="7.4.1"
ARG AZURE_CLI_VERSION="2.42.0"
ARG PULUMI_VERSION="3.80.0"

# Install Azure-CLI
# Get Microsoft signing key
RUN sudo mkdir -p /etc/apt/keyrings \
&& curl -sLS https://packages.microsoft.com/keys/microsoft.asc | \
gpg --dearmor | \
sudo tee /etc/apt/keyrings/microsoft.gpg > /dev/null \
&& sudo chmod go+r /etc/apt/keyrings/microsoft.gpg \
&& AZ_DIST=$(lsb_release -cs) \
&& echo "deb [arch=`dpkg --print-architecture` signed-by=/etc/apt/keyrings/microsoft.gpg] https://packages.microsoft.com/repos/azure-cli/ $AZ_DIST main" | \
sudo tee /etc/apt/sources.list.d/azure-cli.list \
&& sudo apt-get update \
&& sudo apt-get install azure-cli=$AZURE_CLI_VERSION-1~$AZ_DIST
RUN apt-get update \
&& export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends \
git \
libssl-dev \
python3-sphinx

# Install Powershell
# Pull different binaries from Github depending on system architecture
# The standard APT method currently only works for `amd64`
# Set up TARGETARCH variable to use to pull the right binaries for the current architecture.
# Set up TARGETARCH variable to use to pull the right binaries
# for the current architecture.
ARG TARGETARCH
RUN if [ "${TARGETARCH}" = "arm64" ]; \
then \
DEBARCH="arm64"; \
else \
DEBARCH="x86"; \
fi; \
curl -L -o /tmp/powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v${PWSH_VERSION}/powershell-${PWSH_VERSION}-linux-$DEBARCH.tar.gz \
&& mkdir -p /opt/microsoft/powershell/7 \
&& tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/7 \
&& chmod +x /opt/microsoft/powershell/7/pwsh \
&& ln -s /opt/microsoft/powershell/7/pwsh /usr/bin/pwsh

# Install Azure-CLI
# Standard install method currently does not support ARM64
# Use pip instead - https://github.com/Azure/azure-cli/issues/22875
RUN pip3 install azure-cli==${AZURE_CLI_VERSION}
RUN pip3 install hatch

# Create non-root user and give them sudo access
ARG USERNAME=deploydsh
Expand All @@ -64,9 +40,5 @@ USER $USERNAME
COPY ./docs/requirements.txt /build/requirements.txt
RUN pip3 install -r /build/requirements.txt

# Install/check needed powershell modules
COPY ./deployment/CheckRequirements.ps1 /build/CheckRequirements.ps1
COPY ./deployment/common/Logging.psm1 /build/common/Logging.psm1
RUN pwsh -Command "& {Set-PSRepository -Name PSGallery -InstallationPolicy Trusted}" \
&& pwsh -File /build/CheckRequirements.ps1 -InstallMissing -IncludeDev\
&& sudo rm -rf /build/
# Set PATH for pulumi - pulumi installed as feature to work round installing as root
ENV PATH=$PATH:/home/${USERNAME}/.pulumi/bin
42 changes: 23 additions & 19 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
// Development container for the Data Safe Haven project
// Development container for the Data Safe Haven project pulumi
{
"name": "Turing Data Safe Haven",
"build": {
"context": "..",
"dockerfile": "Dockerfile"
},
"customizations": {
"vscode": {
"settings": {
"terminal.integrated.defaultProfile.linux": "bash"
},
"extensions": [
"github.vscode-pull-request-github",
"ms-vscode.powershell",
"ms-vscode.azure-account"
]
}
},
"remoteUser": "deploydsh"
"name": "Turing Data Safe Haven - Pulumi",
"build": {
"context": "../..",
"dockerfile": "Dockerfile"
},
"settings": {
"terminal.integrated.defaultProfile.linux": "bash"
},
"extensions": [
"github.vscode-pull-request-github",
"ms-vscode.powershell",
"ms-vscode.azure-account",
"ms-python.python",
"christian-kohler.path-intellisense"
],
"remoteUser": "deploydsh",
"features": {
"ghcr.io/devcontainers-contrib/features/pulumi:1": {
"version": "3.80.0",
"bashCompletion": false
}
}
}
44 changes: 0 additions & 44 deletions .devcontainer/python/Dockerfile
JimMadge marked this conversation as resolved.
Show resolved Hide resolved

This file was deleted.

25 changes: 0 additions & 25 deletions .devcontainer/python/devcontainer.json
JimMadge marked this conversation as resolved.
Show resolved Hide resolved

This file was deleted.

1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/release_checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Refer to the [Deployment](https://data-safe-haven.readthedocs.io/en/latest/deplo
- [ ] Save the transcript of your tier 2 SRE deployment
- [ ] Save the transcript of your tier 3 SRE deployment
- [ ] Complete the [Security evaluation checklist](https://data-safe-haven.readthedocs.io/en/latest/deployment/security_checklist.html) from the deployment documentation
- [ ] Update [SECURITY.md](../../SECURITY.md) and [VERSIONING.md](../../VERSIONING.md)

### For major releases

Expand Down
42 changes: 0 additions & 42 deletions .github/ISSUE_TEMPLATE/software_package_request.md

This file was deleted.

1 change: 0 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ Replace the empty checkboxes [ ] below with checked ones [x] accordingly.
- [ ] You are targeting the appropriate branch. If you're not certain which one this is, it should be **`develop`**.
- [ ] Your branch is up-to-date with the **target branch** (it probably was when you started, but it may have changed since then).
- [ ] You have marked this pull request as a **draft** and added `'[WIP]'` to the title if needed (if you're not yet ready to merge).
- [ ] You have formatted your code using appropriate automated tools (for example `./tests/AutoFormat_Powershell.ps1 -TargetPath <path to file or directory>` for Powershell).

### :arrow_heading_up: Summary

Expand Down
4 changes: 3 additions & 1 deletion .github/scripts/update_docker_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def annotate(
return annotated


for filename in (pathlib.Path("data_safe_haven") / "pulumi").glob("**/*.py"):
for filename in (pathlib.Path("data_safe_haven") / "infrastructure").glob("**/*.py"):
needs_replacement = False
lines = []
with open(filename) as f_pulumi:
Expand All @@ -87,6 +87,8 @@ def annotate(
print(f"Updating {image} from {v_current} to {v_latest} in {filename}") # noqa: T201
needs_replacement = True
output = line.replace(v_current, v_latest)
else:
print(f"Leaving {image} at {v_current} (latest version) in {filename}") # noqa: T201
lines += output

if needs_replacement:
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/update_docker_versions.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
---
name: Update Pulumi Docker image versions

# Run workflow on pushes to matching branches
on: # yamllint disable-line rule:truthy
push:
branches: [python-migration]
schedule:
- cron: "0 0 */7 * *" # run once per week
- cron: "0 3 * * 1" # run at 3:00 every Monday
workflow_dispatch: # allow this workflow to be manually triggered

# checkout needs 'contents:read'
Expand Down
70 changes: 0 additions & 70 deletions deployment/CheckRequirements.ps1

This file was deleted.

17 changes: 0 additions & 17 deletions deployment/ShowConfigFile.ps1

This file was deleted.

Loading
Loading