Skip to content

Commit

Permalink
Merge pull request #4 from nutanixdev/release-0.3.0
Browse files Browse the repository at this point in the history
Release 0.3.0
  • Loading branch information
pipoe2h authored Nov 9, 2023
2 parents 007b244 + 249641b commit 05fc668
Show file tree
Hide file tree
Showing 8 changed files with 137 additions and 60 deletions.
26 changes: 7 additions & 19 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ ARG COOKIECUTTER_VERSION="none"

COPY library-scripts/*.sh /tmp/library-scripts/

# Persist bash history - https://code.visualstudio.com/remote/advancedcontainers/persist-bash-history
# Persist bash/zsh history - https://code.visualstudio.com/remote/advancedcontainers/persist-bash-history
RUN SNIPPET="export PROMPT_COMMAND='history -a' && export HISTFILE=/home/$USERNAME/.nutanixdev/.bash_history" \
&& mkdir /home/$USERNAME/.nutanixdev \
&& touch /home/$USERNAME/.nutanixdev/.bash_history \
&& chown -R $USERNAME /home/$USERNAME/.nutanixdev \
&& echo "$SNIPPET" >> "/home/$USERNAME/.bashrc"
&& mkdir /home/$USERNAME/.vscode-server \
&& chown -R $USERNAME /home/$USERNAME \
&& echo "$SNIPPET" | tee -a /home/$USERNAME/.bashrc /home/$USERNAME/.zshrc

# Install OpenShift CLI
RUN if [ "${OPENSHIFT_CLI_VERSION}" != "none" ]; then \
Expand All @@ -39,8 +40,8 @@ RUN if [ "${OPENSHIFT_INSTALL_VERSION}" != "none" ]; then \

# Install Ansible
RUN if [ "${ANSIBLE_VERSION}" != "none" ]; then \
pip3 --disable-pip-version-check --no-cache-dir install jmespath ansible==${ANSIBLE_VERSION} \
&& su vscode -c "ansible-galaxy collection install nutanix.ncp"; \
pip3 --disable-pip-version-check --no-cache-dir install ansible==${ANSIBLE_VERSION} \
&& su $USERNAME -c "ansible-galaxy collection install nutanix.ncp"; \
fi

# Install Packer
Expand All @@ -60,7 +61,7 @@ RUN if [ "${K9S_VERSION}" != "none" ]; then \

# Install kubectl karbon
RUN if [ "${KUBECTL_KARBON}" != "false" ]; then \
su vscode -c "umask 0002 && . /tmp/library-scripts/kubectlkarbon-linux.sh"; \
su $USERNAME -c "umask 0002 && . /tmp/library-scripts/kubectlkarbon-linux.sh"; \
fi

# Install Calm DSL
Expand All @@ -76,15 +77,6 @@ RUN if [ "${COOKIECUTTER_VERSION}" != "none" ]; then \
pip3 --disable-pip-version-check --no-cache-dir install cookiecutter==${COOKIECUTTER_VERSION}; \
fi

# [Optional] If your pip requirements rarely change, uncomment this section to add them to the image.
# COPY requirements.txt /tmp/pip-tmp/
# RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt \
# && rm -rf /tmp/pip-tmp

# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>

# Copy all requirement files
COPY requirements/*.txt /tmp/pip-tmp/

Expand All @@ -95,7 +87,3 @@ RUN if [ "${NUTANIX_V4_SDK}" != "false" ]; then \

# Delete all requirement files in tmp
RUN rm -rf /tmp/pip-tmp

# [Optional] Uncomment this line to install global node packages.
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1

42 changes: 26 additions & 16 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,37 @@
"VARIANT": "3.11-bullseye",
// Options
"ANSIBLE_VERSION": "7.3.0",
"PACKER_VERSION": "1.8.6",
"CALM_DSL_VERSION": "3.6.1", // "master",
"PACKER_VERSION": "1.9.2",
"CALM_DSL_VERSION": "3.7.0", // "master",
"KUBECTL_KARBON": "true",
"NUTANIX_V4_SDK": "true",
"OPENSHIFT_CLI_VERSION": "stable-4.12",
"OPENSHIFT_INSTALL_VERSION": "stable-4.12",
"CLUSTERCTL_VERSION": "1.3.5",
"K9S_VERSION": "0.27.3",
"COOKIECUTTER_VERSION": "2.1.1"
"OPENSHIFT_CLI_VERSION": "stable-4.14",
"OPENSHIFT_INSTALL_VERSION": "stable-4.14",
"CLUSTERCTL_VERSION": "1.5.3",
"K9S_VERSION": "0.27.4",
"COOKIECUTTER_VERSION": "2.4.0"
}
},
"mounts": [
"source=vscode-devcontainer-nutanixdev-calmdsl-cache-${devcontainerId},target=/home/vscode/.calm,type=volume",
"source=vscode-devcontainer-nutanixdev-bashhistory-${devcontainerId},target=/home/vscode/.nutanixdev,type=volume"
"source=vscode-devcontainer-nutanixdev-calmdsl-cache-${devcontainerId},target=/calm,type=volume",
"source=vscode-devcontainer-nutanixdev-bashhistory-${devcontainerId},target=/nutanixdev,type=volume",
"source=vscode-devcontainer-nutanixdev-profile-${localWorkspaceFolderBasename}-${devcontainerId},target=/home/vscode,type=volume",
"target=/home/vscode/.vscode-server,type=volume"
],
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {},
"ghcr.io/devcontainers/features/github-cli:1": {
"version": "2.25.1"
"version": "2.38.0"
},
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {},
"ghcr.io/devcontainers/features/powershell:1": {
"version": "7.3.3"
"version": "7.3.9"
},
"ghcr.io/devcontainers/features/terraform:1": {
"version": "1.4.6",
"tflint": "0.45.0",
"terragrunt": "0.44.5"
"version": "1.5.5",
"tflint": "0.48.0",
"terragrunt": "0.53.1"
}
},
"postCreateCommand": "bash .devcontainer/postCreateCommand.sh",
Expand All @@ -47,9 +50,16 @@
},
"extensions": [
"richie5um2.vscode-statusbar-json-path",
// "mutantdino.resourcemonitor",
"mutantdino.resourcemonitor",
"ms-kubernetes-tools.vscode-kubernetes-tools",
"humao.rest-client"
"humao.rest-client",
"mhutchie.git-graph",
"johnpapa.vscode-peacock",
"wayou.vscode-todo-highlight",
"timonwong.shellcheck",
"streetsidesoftware.code-spell-checker",
"yzhang.markdown-all-in-one",
"vscode-icons-team.vscode-icons"
]
}
}
Expand Down
12 changes: 11 additions & 1 deletion .devcontainer/postCreateCommand.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,14 @@ fi
if command -v pwsh > /dev/null 2>&1
then
pwsh -Command Install-Module Nutanix.Cli -Force
fi
fi

if [ -d "/calm" ] && [ -z "$(ls -A $HOME/.calm)" ]
then
sudo cp -a /calm/. $HOME/.calm/
fi

if [ -d "/nutanixdev" ] && [ -z "$(ls -A $HOME/.nutanixdev)" ]
then
cp -a /nutanixdev/. $HOME/.nutanixdev/
fi
15 changes: 9 additions & 6 deletions .devcontainer/requirements/requirements_nutanix_v4_sdk.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
ntnx-aiops-py-client==4.0.1a1
ntnx-clustermgmt-py-client==4.0.1a1
ntnx-aiops-py-client==4.0.3a2
ntnx-clustermgmt-py-client==4.0.2a2
ntnx-dataprotection-py-client==4.0.1a4
ntnx-files-py-client==4.0.1a2
ntnx-iam-py-client==4.0.1a1
ntnx-iam-py-client==4.0.2a1
ntnx-lcm-py-client==4.0.1a1
ntnx-prism-py-client==4.0.1a1
ntnx-storage-py-client==4.0.1a2
ntnx-vmm-py-client==4.0.1a1
ntnx-microseg-py-client==4.0.1a1
ntnx-networking-py-client==4.0.1b1
ntnx-prism-py-client==4.0.3a2
ntnx-storage-py-client==4.0.2a3
ntnx-vmm-py-client==4.0.3a1
2 changes: 2 additions & 0 deletions .devcontainer/requirements/requirements_partners_sdk.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
boto3==1.28.77
jmespath==1.0.1
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Auto detect text files and perform EOL normalization
* text=auto eol=lf

# Windows batch files require CRLF
*.{cmd,[cC][mM][dD]} text eol=crlf
*.{bat,[bB][aA][tT]} text eol=crlf
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
2023-11-09

- Added: support for persistent user profile
- Added: Nutanix Leap, Microseg and Networking SDKs
- Update: normalize files
- Update: Fix bash history to include zsh
- Update: Move jmespath to requirements file
- Update: bump tools and SDKs versions

2023-06-14

- Added: Fix for k9s
- Added: Included GitHub CLI
- Added: README update with Windows notes
- Added: get_task_info call to v4 API example
- Added: Ansible example
- Added: Terraform example
- Added: api v4 example
- Added: cookiecutter to container
- Update: Bump tool versions
- Update: Improve post create commands by using conditions
- Update: Expand on how it works
- Update: Bump Terraform version and add jsonpath support for Ansible
- Update: include rest client setting
- Update: Standardize pip installation
- Update: Readme and contributing
- Update: Calm master branch support
- Update: Fix Terragrunt version until they fix their repo
- Update: Include missing CLIs
- Update: fix operator
- Update: k9s uses different arch for amd64
- Update: remove env
- Update: cleanup tools

2022-08-08

- Added: First devcontainer draft
57 changes: 39 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@ git clone https://github.com/nutanixdev/nutanix-devstation.git --config core.aut
### CLIs

- [x] Python v3.11.x
- [x] Calm DSL v3.6.1
- [x] Ansible v2.14.3 (pip v7.3.0)
- [x] Terraform v1.4.6
- [x] PowerShell v7.3.3
- [x] Packer v1.8.6
- [x] Kubectl v1.26.2
- [x] Helm v3.11.2
- [x] minikube v1.29.0
- [x] Kubectl-karbon v0.9.6
- [x] OpenShift CLI (oc) v4.12.6
- [x] OpenShift Install CLI v4.12.6
- [x] Clusterctl v1.3.5
- [x] k9s v0.27.3
- [x] Cookiecutter v2.1.1
- [x] GitHub CLI v2.25.1
- [x] Calm DSL v3.7.0
- [x] Ansible v2.14.11 (pip v7.3.0)
- [x] Terraform v1.5.5
- [x] PowerShell v7.3.9
- [x] Packer v1.9.2
- [x] Kubectl v1.28.3
- [x] Helm v3.13.1
- [x] minikube v1.31.2
- [x] Kubectl-karbon v0.11.4
- [x] OpenShift CLI (oc) v4.14.1
- [x] OpenShift Install CLI v4.14.1
- [x] Clusterctl v1.5.3
- [x] k9s v0.27.4
- [x] Cookiecutter v2.4.0
- [x] GitHub CLI v2.38.0
- [ ] Nutanix CLI (nCLI)
- [ ] Acropolis CLI (aCLI)

Expand Down Expand Up @@ -65,13 +65,25 @@ Additionally, two container volumes are used for persisting Calm DSL cache and b

## How to use

### Quick Install

1. Clone, or download and extract the repository.

2. Open the folder in VS Code and when prompted, click `Reopen in Container`.

3. Enjoy the Nutanix Dev Station!

### Re-use Dev Containers in another project

You only need the `.devcontainer` directory in the project root folder:

1. Clone or download the repository.
1. Clone, or download and extract the repository.

2. Copy or move the `.devcontainer` directory to your project.

1. Copy or move the `.devcontainer` directory to your project.
### Advanced Settings

1. To enable/disable or configure different tool versions, edit the `devcontainer.json` file in the `.devcontainer` directory.
To enable/disable or configure different tool versions, edit the `devcontainer.json` file in the `.devcontainer` directory.

## How to contribute

Expand All @@ -85,6 +97,15 @@ https://www.nutanix.com/legal/terms-of-use

## CHANGELOG

### Version 0.3.0

- Support for persistent user profile (.calm and .nutanixdev volumes are migrated to a new one)
- Tool versions have been updated.
- Fix zsh history.
- Include detailed changelog file.
- Update and include new Nutanix SDKs for Nutanix Disaster Recovery, Microseg and Networking.
- Normalization (LF and CRLF)

### Version 0.2.0

This version is EA and has been tested with different OSes and container engines.
Expand Down

0 comments on commit 05fc668

Please sign in to comment.